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!!

avatar user

Helpful resources

Announcements
March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)