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.
v-zhangti
4 years agoCommunity Support
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.