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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dominic91
New Member

YTD and running Totals

YTD Sum RT =
CALCULATE(
    SUM('TotalSale+LIS'[Liters]),
    FILTER(
        ALLSELECTED('TotalSale+LIS'),
        'TotalSale+LIS'[Date] <= MAX('TotalSale+LIS'[Date])
            && YEAR('TotalSale+LIS'[Date]) = YEAR(MAX('TotalSale+LIS'[Date]))
    )
)
i wrote the dax above in hopes that i would get a running total on my line graph and it worked, but now i would like to show on the same line graph, a line for each year rather than all years as one line. i am struggling to figure out how i can apply, for example, only 2019 dates into this dax. what i have tried so far isnt working, and chat gpt also cant figure this out it seems. any help would be greatly appreciated. 
1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

you need a year dimension in the visual legend.

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

you need a year dimension in the visual legend.

Great, that worked. thanks for the help!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.