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
chris_k
Helper I
Helper I

De-cumulative values by date

Hello,

 

I have a data set that contains a cumulative column (it is connected to the BI service so I am trying to avoid using a calculated column, ideally I need a DAX measure).

 

I need to produce a line graph that always starts at zero and goes up using this cumulative column.

So essentially minus the earliest date selected from the whole column (when sliced) to start the line at zero and climb upwards.

 

Ive had an attempt at getting the EARLIEST date and minus it from the data but cant seem to get it to work...

 

Any ideas would be appreciated.

 

Thanks,

 

Example:

 

01/01/201710
01/02/201715
01/03/201720
01/04/201725
01/05/201830
01/06/201735

 

So the when sliced by 01/03/2017 onwards the line would start at 0 and then show 5, 10, 15.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @chris_k

 

Try this MEASURE

 

Measure =
VAR EarliestDate =
    CALCULATE ( MIN ( TableName[Date] ), ALLSELECTED () )
VAR StartValue =
    CALCULATE (
        SUM ( TableName[Cumulative Values] ),
        TableName[Date] = EarliestDate
    )
RETURN
    SUM ( TableName[Cumulative Values] ) - StartValue

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

HI @chris_k

 

Try this MEASURE

 

Measure =
VAR EarliestDate =
    CALCULATE ( MIN ( TableName[Date] ), ALLSELECTED () )
VAR StartValue =
    CALCULATE (
        SUM ( TableName[Cumulative Values] ),
        TableName[Date] = EarliestDate
    )
RETURN
    SUM ( TableName[Cumulative Values] ) - StartValue

Regards
Zubair

Please try my custom visuals

Worked perfectly. Thank you!

@chris_k

 

1094.png


Regards
Zubair

Please try my custom visuals

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.