Forum Discussion

HB13's avatar
HB13
Helper I
4 years ago
Solved

How to create a dynamic DAX measure value that changes according to the filter applied on the visual

Hi all! I have this DAX measure in Power BI; CALCULATE ( SUM(Table1[amount]) , YEAR(Table2[date]) = 2021 )   This measure is used in a visual that is being filtered by a _DateTable[date], that ...
  • Adescrit's avatar
    4 years ago

    Hi HB13 

     

    You could try:

     

    Measure = 
    VAR __SelectedYear = SELECTEDVALUE(DateTable[Year])
    RETURN
    CALCULATE ( SUM(Table1[amount]) , YEAR(Table2[date]) = __SelectedYear )

     

    I'm assuming there is a column [Year] in the DateTable for this to work.