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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Brannon
Regular Visitor

Cumulative Measure in Line Graph works, but not with date hierarchy

I have a cumulative measure, and when I have the chart broken down to weeks the measure works as expected, but when rolling up to months my cumulative line continues to the end of the date field. Everything is calculating correctly, I just am not getting the actual cumulative line to stop at the data date.

 

By week:

Brannon_0-1675352803227.png

 

 

By Month:

Brannon_1-1675353641044.png

 

 

 

 

Here is the dax I am using:

Actual Cumulative =
IF(selectedvalue(Dates[Merged])<=(LASTDATE('Curr Data'[Data Date])-6),
CALCULATE (
SUMX ( filter('Curr Data','Curr Data'[Spreadsheet Field] = "Actual Units" || 'Curr Data'[Spreadsheet Field] = "Period Actual Units"),'Curr Data'[Value] ),
FILTER (
ALL(Dates[Merged]),
(Dates[Merged]<= max(Dates[Merged]))
))
)
 
 
Thanks for any help you folks may have.
 
Brannon
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try changing SELECTEDVALUE to MAX. SELECTEDVALUE will return blank if multiple dates are visible in the filter context, and blank evaluates as less than any date.

View solution in original post

2 REPLIES 2
Brannon
Regular Visitor

THANK YOU! I've been searching all over for a solution for that, MAX worked. 

johnt75
Super User
Super User

Try changing SELECTEDVALUE to MAX. SELECTEDVALUE will return blank if multiple dates are visible in the filter context, and blank evaluates as less than any date.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors