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

Cumulative Sum for PY and CY on Same Chart

I want a cumulative line chart for PY and CY sales on the same visual. I have it working right now, except I want PY sales to show for the whole year, not just YTD like CY sales are. So, it looks like this:

Brotedo_0-1665419641056.png

but I want to see all of the previous year sales.

This is my measure right now.

IncentiveSumTestPY = 
var yearnum = LOOKUPVALUE('dw dimDate'[YearNum],'dw dimDate'[FullDate], today())


RETURN

    if(max('dw dimDate'[FullDate])>today(), blank(),
    
    CALCULATE(sum('dw factSales'[IncentiveSales]), filter(all('dw dimDate'), 'dw dimDate'[DayNumOfYear]<=max('dw dimDate'[DayNumOfYear])),'dw dimDate'[YearNum]=yearnum-1
    
    
    
    ))

 

1 ACCEPTED SOLUTION
Brotedo
Helper I
Helper I

Nevermind, I solved this myself. 

View solution in original post

1 REPLY 1
Brotedo
Helper I
Helper I

Nevermind, I solved this myself. 

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.