Forum Discussion
gmasta1129
Resolver I
4 years agoPrevious Day Function (Weekends excluded)
Hello, I have data for Monday to Friday only. I am using the formula below to compare the previous day minus today's values. My issue is with Monday's calculation showing that there is a di...
- 4 years ago
gmasta1129
You can use the following measure to get the desired results.Difference = VAR __CurrentDate = MAX ( 'daily_report'[date time] ) VAR _LastDate = LASTDATE ( FILTER ( ALL ( 'daily_report'[date time] ), 'daily_report'[date time] < __CurrentDate && NOT WEEKDAY ( 'daily_report'[date time], 2 ) IN { 6, 7 } ) ) VAR __Result = CALCULATE ( SUM ( daily_report[total value usd] ), _LastDate ) RETURN __Result - 4 years ago
Hello,
It worked! i just made a small change to the VAR Result portion of the formula you sent.
Thank you so much for your help!!! I was working on it for hours to try and figure it out before i went to this website.
Fowmy
Super User
4 years agogmasta1129
You can use the following measure to get the desired results.
Difference =
VAR __CurrentDate =
MAX ( 'daily_report'[date time] )
VAR _LastDate =
LASTDATE (
FILTER (
ALL ( 'daily_report'[date time] ),
'daily_report'[date time] < __CurrentDate
&& NOT WEEKDAY ( 'daily_report'[date time], 2 ) IN { 6, 7 }
)
)
VAR __Result =
CALCULATE ( SUM ( daily_report[total value usd] ), _LastDate )
RETURN
__Result
- gmasta11294 years ago
Resolver I
Hello,
It worked! i just made a small change to the VAR Result portion of the formula you sent.
Thank you so much for your help!!! I was working on it for hours to try and figure it out before i went to this website.