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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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