Forum Discussion

brunofs123's avatar
brunofs123
Frequent Visitor
7 years ago
Solved

Dynamic filters - Selected Value - DAX

Hello!   I have two tables, CALENDAR TABLE and the Fact Table.   In Fact Table I have TWO date columns, let’s call FT[date1] and FT[date2].   Both tables are connected. Calendar[Date] à FT[date...
  • v-frfei-msft's avatar
    v-frfei-msft
    7 years ago

    Hi brunofs123,

     

    To create a new calculated table and do not create relationship for the new table with other ones.

     

    _newCalendar = CALCULATETABLE('dCalendar')

    Then we can add the date column in the new table in slicer and create a measure as below.

     

    out valid DIN 2 = 
    VAR SELECTED = SELECTEDVALUE('_newCalendar'[Date])
    
    RETURN 
     CALCULATE(SUM('FT - Outorgas validas  2'[Volume m3s]),
        FILTER('FT - Outorgas validas  2' ,  
        'FT - Outorgas validas  2'[date venc] >= SELECTED &&
        'FT - Outorgas validas  2'[date public] <= SELECTED)
              )
    

     

    Please refer to the pbix.

     

    Regards,

    Frank