sum wrt previous outstanding amount and month current amount

0 votes
Hi i want to create column wrt balance to be paid wrt to previous month i.e the previous month outstanding amount and current month amount. How to do this? if my previous amount to be paid is 4000 and only 3000 is paid then 1000 should be added to this month amount to be paid.
Jun 6 in Tableau by keerthi
20 views

1 answer to this question.

0 votes

Hi Keerthi,

I used a similar data to show whether the day has reached sales for day or else added to next day to show the demo.

The below code is for finding the amount to be paid after adding previous balance - To be paid

IF ISNULL(ZN(SUM([AMT PAID])) - LOOKUP(ZN(SUM([AMT PAID]) - [AMT TO BE PAID]), -1)) THEN [AMT TO BE PAID] ELSE ZN(SUM([AMT PAID])) - LOOKUP(ZN(SUM([AMT PAID]) - [AMT TO BE PAID]), -1) END

Use below code to find the amount balance that is paid in the next step - balance

[To be paid] - SUM([Sales])

A simple demo image for your problem - 

Hope this helps you!

answered Jun 6 by Cherukuri
• 21,150 points

Related Questions In Tableau

0 votes
1 answer

Sum of previous two months sales where the current month is entered by the user.

It can be achieved easily by creating ...READ MORE

answered Aug 14, 2018 in Tableau by AwesomeSauce
• 860 points
53 views
0 votes
1 answer

Is it possible to merge year, month and date in Tableau?

Remove all the date pills and drag ...READ MORE

answered May 9, 2018 in Tableau by Atul
• 5,530 points
28 views
0 votes
1 answer

How to merge Year ,Month and date in Order Date in Tableau?

Hi, you can simply drag the Order ...READ MORE

answered Aug 24, 2018 in Tableau by AwesomeSauce
• 860 points
67 views
0 votes
0 answers

Row wise difference wrt to total and left quantity.

Hi, i have number of goods to ...READ MORE

May 17 in Tableau by rahul
16 views
0 votes
1 answer

How to determine average per event by year?

Hi Roshan, Create a new calculated field (use ...READ MORE

answered Sep 25, 2018 in Tableau by Machdata
• 340 points
52 views
0 votes
0 answers

Calculating count average from averages

I've a calculated field in Tableau which ...READ MORE

May 28, 2018 in Tableau by Mahima Choudhary
21 views
0 votes
1 answer
0 votes
1 answer

How to Split a Measure in Tableau?

Have you tried using an IF statement: IF ...READ MORE

answered Aug 14, 2018 in Tableau by AwesomeSauce
• 860 points
79 views
0 votes
1 answer

How to get distinct customers this year wrt previous year?

Follow the below steps: 1. Create calculated fields ...READ MORE

answered May 16 in Tableau by Cherukuri
• 21,150 points
13 views
0 votes
1 answer

Count of negative profit and positive profit for a month

Hi Anitha, It is easy and simple. Follow ...READ MORE

answered May 20 in Tableau by Cherukuri
• 21,150 points
20 views