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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative to Non-Cumulative Totals - DAX Assistance Needed

Hello all! I've got a data set with cumulative amounts. I'm trying to calculate the non-cumulative monthly totals using DAX . How can I get PowerBI to identify total amount as of today and subtract total amount from last month? 

 

Let me know if you need any more info. Thanks in advance!

 

Current Data Setup:

MonthNameFiscalMonthIntAmount (Cumulative)
OCT0167,904,161
NOV0216,1620,357
DEC03322,803,193
JAN04488,696,422
FEB05714,247,442
MAR06966,124,818
APR071,133,638,748
MAY081,407,021,012
JUN091,518,0556,75
JUL100
AUG110
SEP120

 

I'd like to create a DAX measure that creates a non-cumulative column.

MonthNameFiscalMonthIntAmount (Cumulative)Amount (Non-cumulative)
OCT0167,904,16167,904,161
NOV02161,620,35793,716,196
DEC03322,803,193161,182,836
JAN04488,696,422165,893,229
FEB05714,247,442225,551,020
MAR06966,124,818251,877,376
APR071,133,638,748167,513,930
MAY081,407,021,012273,382,264
JUN091,518,0556,75111,034,663
JUL1000
AUG1100
SEP1200

 

Seems simple but I can't figure it out. Thanks all.

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

MyMeasure =
VAR ThisMonthInt =
    MIN( 'Table'[FiscalMonthInt] )
VAR PreviousMonthInt = ThisMonthInt - 1
VAR ThisAmount =
    MIN( 'Table'[Amount (Cumulative)] )
VAR PreviousAmount =
    CALCULATE(
        MIN( 'Table'[Amount (Cumulative)] ),
        FILTER( ALLSELECTED( 'Table' ), 'Table'[FiscalMonthInt] = PreviousMonthInt )
    )
RETURN
    IF( ThisAmount = 0, 0, ThisAmount - PreviousAmount )

Regards

View solution in original post

1 REPLY 1
Jos_Woolley
Solution Sage
Solution Sage

Hi,

MyMeasure =
VAR ThisMonthInt =
    MIN( 'Table'[FiscalMonthInt] )
VAR PreviousMonthInt = ThisMonthInt - 1
VAR ThisAmount =
    MIN( 'Table'[Amount (Cumulative)] )
VAR PreviousAmount =
    CALCULATE(
        MIN( 'Table'[Amount (Cumulative)] ),
        FILTER( ALLSELECTED( 'Table' ), 'Table'[FiscalMonthInt] = PreviousMonthInt )
    )
RETURN
    IF( ThisAmount = 0, 0, ThisAmount - PreviousAmount )

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors