cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brotedo
Frequent Visitor

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
Frequent Visitor

Nevermind, I solved this myself. 

View solution in original post

1 REPLY 1
Brotedo
Frequent Visitor

Nevermind, I solved this myself. 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.