Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

amount by deducting the sum from previous month's result amount and that resulting amount should

 

Hi Team

I need your help to write a dax function to calculate the amount from previous resulting amount and then that result should serve as a basis for next calculating amount and so on and hence forth.

Below is the dummy data for the same

 

Month IndexRecord amontMonth
0248500443May-19
1238252367Apr-19
2238251056Mar-19
3238251056Feb-19
4-8469733Jan-19
5-8515208Dec-18
6-8516008Nov-18
7-8518568Oct-18
8-8519368Sep-18

 

 Month IndexLAMT AmountRemaining balance 
May-190                           248,075.54         248,252,367.18(Record Amount -LAMT Amount where month Index 0)
Apr-191                                1,311.56         248,251,055.62(May-19 remaining Balance )-(Apr -19 LAMT amount)
Mar-192                                             -           248,251,055.62(Apr-19 remaining Balance )-(Mar -19 LAMT amount)
Feb-193                   246,720,788.38              1,530,267.24So on and So forth
Jan-194                              45,475.00              1,484,792.24 
Dec-185                                    800.00              1,483,992.24 
Nov-186                                2,560.00              1,481,432.24 
Oct-187                                    950.00              1,480,482.24 
Sep-188                                2,665.00              1,477,817.24 
Aug-189                                             -                1,477,817.24 
Jul-1810                                             -                1,477,817.24 
Jun-1811                              25,960.00              1,451,857.24 
May-1812                                3,105.71              1,448,751.53 
Apr-1813                           182,400.50              1,266,351.03 
Mar-1814                                             -                1,266,351.03 
Feb-1815                                4,550.00              1,261,801.03 
Jan-1816                                             -                1,261,801.03 

 

Thanks, 

KK

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You could use this formula to create a measure

Measure = 
CALCULATE (
    SUM ( Dim[Record amont] ),
    FILTER (
        Dim,
        Dim[Month Index] = CALCULATE ( MIN ( Table1[Index] ), ALL ( Table1 ) )
    )
)
    - CALCULATE (
        SUM ( Table1[LAMT Amount] ),
        FILTER ( ALL ( Table1 ), Table1[Index] <= MAX ( Table1[Index] ) )
    )

Result:

1.JPG

here is pbix file, please try it.

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You could use this formula to create a measure

Measure = 
CALCULATE (
    SUM ( Dim[Record amont] ),
    FILTER (
        Dim,
        Dim[Month Index] = CALCULATE ( MIN ( Table1[Index] ), ALL ( Table1 ) )
    )
)
    - CALCULATE (
        SUM ( Table1[LAMT Amount] ),
        FILTER ( ALL ( Table1 ), Table1[Index] <= MAX ( Table1[Index] ) )
    )

Result:

1.JPG

here is pbix file, please try it.

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.