Forum Discussion

CEEGEE_CEEGEE's avatar
CEEGEE_CEEGEE
New Member
2 years ago

Rolling MAT Graphs

Hi there,

I'm kind of stuck up with this graph. Appreciate if you have any workaround that you can suggest.

I'm trying to show a MAT figures for a rolling graph. However, it seems that the DAX that I've used only computes for the YTD figures.

In the picture, the 2024 figure should be around 6.67, same goes for 2022, and 2023 (should be around 6.60+)

 

 

And this is also the DAX that I've used for the above graph:

 

 

Rolling Volume Sticks MAT =
    var MaxDate = MAX(Dates[Date].[Date])
    var MaxEndDate = EDATE(MaxDate,12)
    var Result =
    if(
        HASONEVALUE( 'Presentation Calendar'[Date].[Year] ) &&
        max( 'Presentation Calendar'[Date]) <= MaxEndDate &&
        min( 'Presentation Calendar'[Date]) <= MaxDate,
        CALCULATE([MAT Volume Sticks]/1000000,
        FILTER( ALL(Dates[Date].[Year]),
        'Dates'[Date].[Year] = VALUES( 'Presentation Calendar'[Date].[Year] ) )
        ),
        BLANK()
    )
    Return
    Result
 
This is the DAX that I've used to compute for the MAT figures:
 
MAT Volume Sticks =
calculate([Volume Sticks bn],DATESINPERIOD(Dates[Date].[Date],LASTDATE(Dates[Date].[Date]),-12,month))

 

 

Thanks

1 Reply