Forum Discussion
Dynamic YTD Based On Slicer
- 5 years ago
Hi asteinbach ,
Modify your 2 measures as below:
Revenue_Calc_2021_Actual = Calculate(sum('Revenue_COGS'[Value]),'Revenue_COGS'[Account] = "Revenue",'Revenue_COGS'[Year]=2021,'Revenue_COGS'[Scenario] = "ACTUAL",FILTER(Revenue_COGS,DATE('Revenue_COGS'[Year],Revenue_COGS[Month Number],1)<=SELECTEDVALUE('Months'[Date_Format]))EBITDA_Actual = (Revenue_COGS[Revenue_Calc_2021_Actual] - Calculate(sum(Costs[Value]),Costs[Year]=2021,Costs[Scenario]="ACTUAL",FILTER('Costs', DATE('Costs'[Year],'Costs'[Month Number],1)<=SELECTEDVALUE('Months'[Date_Format]))) + [Dep_Amo_Impair_Actual])And you will see:
As for the orientation from Department_Hiearchy to Revenue_COGS is single and one to many,so when you use month from table Months,the data cant be filtered correctly.That's why you have to add the month filter to the expressions.
Check my .pbix file attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi asteinbach ,
Do you mean the result I marked in red?
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Kelly,
I accidentally marked your last post as a solution, but no it still doesn't work. When I change the month slicer, it does in fact change Revenue Actual. This is because it's being displayed by the "Dynamic Revenue" Measure with Revenue YTD, which is an awful IF statement I wrote and the reason I'm trying to get a better way to do it. The formula you edited still doesn't calculate YTD when the slicer is changed, it's still that single month