Forum Discussion

Thejeswar's avatar
Thejeswar
Super User
8 years ago
Solved

Filter 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 ...
  • Floriankx's avatar
    Floriankx
    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)
    )
    )