Forum Discussion
Thejeswar
Super User
8 years agoFilter with calculated measures
Hello guys, I have been trying to create a calculated measure which should be filtered based on another measure. Here's my scenario 1. I want to create Total YTD of a column which I am doing by ...
- 8 years ago
Hello,
What probably would work perfectly is a separate DateTable with contiguous Dates. Then you could add the DateTable columns to your PivotTable and use it for TOTALYTD.
After trying a little bit this formula gave me the correct result as well:
YTD Revenue:=VAR LatestDate=MAX(FactTable[Datekey]) RETURN CALCULATE(SUM([column]);
CALCULATETABLE(
FILTER(FactTable;FactTable[Datekey]<=LatestDate&&YEAR([Datekey])=YEAR(LatestDate));
ALL(FactTable)
)
)
Floriankx
Solution Sage
8 years agoHello,
What probably would work perfectly is a separate DateTable with contiguous Dates. Then you could add the DateTable columns to your PivotTable and use it for TOTALYTD.
After trying a little bit this formula gave me the correct result as well:
YTD Revenue:=VAR LatestDate=MAX(FactTable[Datekey]) RETURN CALCULATE(SUM([column]);
CALCULATETABLE(
FILTER(FactTable;FactTable[Datekey]<=LatestDate&&YEAR([Datekey])=YEAR(LatestDate));
ALL(FactTable)
)
)
Thejeswar
Super User
8 years agoThis thing works fine. Can you pls. explain this DAX Usage?