Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Good afternoon,
I am looking to work out a value from the last business day,
i.e. if Monday, look back to Friday etc
So far I have the previous days dax as follows:
Solved! Go to Solution.
Hi @ajaydavidluke ,
Please have a try.
Create columns.
weekday=weekday('table'[date],2)
weeknum=weeknum('table'[date],2)
Then create a measure.
Boxes put away previous day =
VAR _1 =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 1
)
VAR _value =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 3
)
RETURN
IF ( 'table'[weekday] = 1, _value, _1 )
If I have misunderstood your meaning, please provide more details withyour desired output and pbix file without privacy infotmaion ( Or some smple data).
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ajaydavidluke ,
Please have a try.
Create columns.
weekday=weekday('table'[date],2)
weeknum=weeknum('table'[date],2)
Then create a measure.
Boxes put away previous day =
VAR _1 =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 1
)
VAR _value =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 3
)
RETURN
IF ( 'table'[weekday] = 1, _value, _1 )
If I have misunderstood your meaning, please provide more details withyour desired output and pbix file without privacy infotmaion ( Or some smple data).
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Good morning,
I have followed your suggestion but I receive the following error:
Hi @ajaydavidluke ,
My fault, I forgot it was a measure and not a column. Please modify the measure again.
Boxes put away previous day =
VAR _1 =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 1
)
VAR _value =
CALCULATE (
SUM ( 'Stock replenishment records'[Box est v2] ),
'Stock replenishment records'[Date]
= TODAY () - 3
)
RETURN
IF ( max('table'[weekday] )= 1, _value, _1 )
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |