Forum Discussion
Trebor84
3 years agoHelper II
Date.DayOfWeek with Date.IsInPreviousNDays
Hi, I'm trying to find a way to avoid my Power Bi report showing data over the weekend when the report refreshes. If today is Saturday then don't show Saturdays data or Fridays. If today is Sun...
Anonymous
3 years agoNot applicable
Hi Trebor84 ,
For a visual with a date axis, I would consider adding a filter to the visual.
Measure =
VAR _today = TODAY()
VAR _weekday = WEEKDAY(_today,2)
VAR _filter =
SWITCH(
TRUE(),
NOT _weekday IN {6,7} && SELECTEDVALUE('Table'[Date]) < _today, 1,
_weekday = 6 && SELECTEDVALUE('Table'[Date]) < _today-1, 1,
_weekday = 7 && SELECTEDVALUE('Table'[Date]) < _today-2, 1
)
RETURN
_filter
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum