Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Default Date

I have Calculated Dates filter and slicers and It is perfectly working fine. I even added a TODAY filter that only filters based on today's data.   But the problem is that whenever i open the repo...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

    Dynamically show today's value by default by slicer is not supported in power bi.

    In addition to  

    Measure = IF(MAX('Table'[Date])>= DATE(YEAR(TODAY()),01,01) && MAX('Table'[Date])<=TODAY(),1,0)

    Set this filter to show items when value =1.

    However if you use this measure filter in your visual, it won't show values after today or before start day.

    I update a new measure, build a date table for slicer.

    Measure1 = 
    VAR _MINDate = MIN('Date'[Date])
    VAR _MAXDate = MAX('Date'[Date])
    Return
    IF(MAX('Table'[Date])>=_MINDate && MAX('Table'[Date])<=IF(_MAXDate>=TODAY(),_MAXDate,TODAY()),1,0)

    By this measure it will show dynamic result by slicer.

    If we change slicer from 2020/12/01 to 2021/02/19, it will show result we want.

    Due to you use Between in slicer, this measure has a disadvantage that if the maxdate in slicer >Today when you open your report, it will show you values in maxdate instead of today. 

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

  • TWorku's avatar
    5 years ago

    I had same issue. This is what I did if it helps.

     

    I added calcuated column 

    Is-Today = IF(MyDateTable[Date] <= TODAY(), "True", "False"). 
     
    then i filtered as follows
     

    It works perfectly fine for me.