Forum Discussion

mussaenda's avatar
mussaenda
Community Champion
7 years ago
Solved

Date Slicer

I have a date table and my fact table. My fact table has Due Dates.   I want to have a slicer of dates that will filter the due dates of the table i have.   for example: Slicer date is 31/08/20...
  • parry2k's avatar
    7 years ago

     

    mussaenda add following two measures and see if it works

     

    Is date before max date = 
    VAR __date = MAX( 'Calendar'[Date] )
    RETURN 
    CALCULATE( COUNTROWS( 'Table 1' ), 'Table 1'[Due Date] <= __date)
    Delay Days = 
    DATEDIFF( MAX( 'Table 1'[Due Date] ), MAX( 'Calendar'[Date] ), DAY ) * 
    DIVIDE( [Is date before max date],[Is date before max date] )

    in table visual add following

     

    - Doc No

    - Due Date

    - Delay Days

     

    and you will get the result