Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Relative Date Filter automatically changes from months to days

I have a visual for which I automatically only want to show all days in the current calendar month until yesterday. Yes, this means that on the first day of the month you have an empty visual.   I ...
  • v-juanli-msft's avatar
    7 years ago

    Hi Anonymous 

    Here is a workaround.

    Create measures, then add [flag] in the visual level filter

    In my example, today=2019/1/25

    today = TODAY()
    
    today-year = YEAR([today])
    
    today-month = MONTH([today])
    
    flag =
    IF (
        MAX ( 'Table'[year] ) = [today-year]
            && MAX ( 'Table'[month] ) = [today-month]
            && MAX ( 'Table'[Date] ) < [today],
        1,
        0
    )
    

     

    Best Regards

    Maggie

     

    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.