Combining MTD and YTD into one DAX


In all my tables/graphs I only require MTD or YTD (linked to a slicer). I have successfully changed all my DAX using the below structure:
VAR PeriodTableMTD = [Period Table Data] = “MTD”
VAR PeriodTableYTD = [Period Table Data] = “YTD”
TRUE (),
PeriodTableMTD, CALCULATE([IS] , Summary[Income Statement Items] = “EBITDA”) ,
PeriodTableYTD, CALCULATE([IS] , Summary[Income Statement Items] = “EBITDA” , DATESYTD(‘Date’[Month & Year] )))

The only formula I am struggling to modify is this one:

VAR CURRENTITEM = TRIM(SELECTEDVALUE( 'Summary P&L template'[Income Statement Items]))

    CALCULATE( [IS] , FILTER(Summary , Summary[Income Statement Items] = CurrentItem)) 

Tried using the same format as the above EBITDA DAX, with no success.

Any recommendations?

Do you mean that when you choose MTD the graph should show MTD calculation and when you select YTD it should show YTD calculation? Also I am not sure how you are using the EBITDA dax, can you share the file?

Correct, just need the CY formula changed, so that when I select the MTD OR YTD slicer, it pulls through CY MTD OR YTD data.

EBITDA formula pulls through EBITDA from the source excel document imported in. Just need the same for CY

Running Total.pbix (2.0 MB)

Try this model, see if this is what you want.

No, I currently have it setup like that. I want to try combine the steps like I did with EBITDA.