Forum Discussion
dyee4613v1
1 year agoFrequent Visitor
Flexible Month Calculation
Hi. I'm trying to do MTD/YTD/YTD LY calculations and the calculations need to be flexible based on a month filter. Here is how I wanted to do it. 1. YTD = CALCULATE(Sum(GL[AMOUNT]),'Invoked Fun...
- 1 year ago
Hi, if your Date table is already properly marked as a Date table in Power BI I'd suggest using time intelligence function instead of comparing the date text.So for your MTD it would be
MTD =
VAR MaxSelectedDate = MAX('Invoked Function'[Date])
RETURN
CALCULATE(
SUM(GL[AMOUNT]),
DATESMTD('Invoked Function'[Date]),
'Invoked Function'[Date] <= MaxSelectedDate
)
dyee4613v1
1 year agoFrequent Visitor
I'm an idiot. I was trying calculate table and all this nonsense. The normal MTD calculation does everything I need. Thank you Mason!
- MasonMA1 year agoSuper User
Happy to see it works:)