Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Use Dax to replicate Legend

Hi all,

 

I'm trying to recreate the following chart:

It is a running total, but in this case, I'm using a single measure but adding the year column as a legend. For a new report, I'm working on I need to recreate it using Dax; one measure for 2020 and the other 2019. Whenever I try it to create using the same measure just adding an additional filter the result is the following.

 

The flat line is 2019 and instead of showing a running total shows just total for the year. I'm using the following Dax.

 

Running_total_2019 = CALCULATE(
    [Total_2019],
    FILTER( ALLSELECTED( 'Calendar'),
    'Calendar'[Date] <= 'Calendar'[Date]
    )
)

 

 Total_2019 is a sum of a calculates table to filter sales for the year and a sales stage. I've tried modifying it to use DATESYTD and TOTALYTD but didn't work.

 

Thanks for the help.

2 Replies