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, 2019 in Tableau 323 views

## 1 answer to this question.

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!

• 33,010 points

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

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

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

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

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

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

## Row wise difference wrt to total and left quantity.

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

## How to determine average per event by year?

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

## Calculating count average from averages

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

## How to return the value on which the condition is met for the first time?

It looks like you are trying to ...READ MORE

## How to Split a Measure in Tableau?

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