Forum Discussion
Anonymous
4 years agoNot applicable
Excluding Weekends - Returning data from Friday on Monday otherwise previous day data
Hello! I'm trying to run a calculation that returns data for the previous day but on Monday, I need to return Friday's values. I know that the PREVIOUSDAY function doesn't work and think that...
- 4 years ago
Hi, Anonymous
You can try the following methods.
Column:
Weekday = WEEKDAY([Date],2)Measure:
Measure = IF ( SELECTEDVALUE ( 'Table'[Weekday] ) IN { 6, 7 }, BLANK (), IF ( SELECTEDVALUE ( 'Table'[Weekday] ) = 1, CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), [Date] = ( SELECTEDVALUE ( 'Table'[Date] ) - 3 ) ) ), CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), [Date] = ( SELECTEDVALUE ( 'Table'[Date] ) - 1 ) ) ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
4 years agoSuper User
Anonymous , refer if this blog of mine can help
Traveling Across Workdays - What is next/previous Working day
https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calendar-4-5-Power/ba-p/1187766
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.