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.
Hello Community,
I have a measure which calculate the count of insepection for yesterdaty based on today's date:
Solved! Go to Solution.
Hi,
I am not sure if I understand correctly about your data model and your calendar table, but please try to write a measure something like below, for inserting a condition that is not including saturday and sunday.
Number of UD taken Yesterday =
VAR _today =
TODAY ()
VAR _yesterdayexceptweekends =
MAXX (
FILTER (
'DIM_Calendar',
'DIM_Calendar'[Date] < _today
&& 'DIM_Calendar'[Weekdayname] <> "Saturday"
&& 'DIM_Calendar'[Weekdayname] <> "Sunday"
),
'DIM_Calendar'[Date]
)
RETURN
CALCULATE (
DISTINCTCOUNT ( 'INSPECTION LOTS DATA - Header'[Inspection lot] ),
ALL ( 'INSPECTION LOTS DATA - Header'[UD Code] ),
USERELATIONSHIP ( 'DIM_Calendar'[Date], 'INSPECTION LOTS DATA - Header'[UD code date] ),
'DIM_Calendar'[Date] = _yesterdayexceptweekends,
'INSPECTION LOTS DATA - Header'[UD Code] <> BLANK ()
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you for you help 🙂
Hi,
I am not sure if I understand correctly about your data model and your calendar table, but please try to write a measure something like below, for inserting a condition that is not including saturday and sunday.
Number of UD taken Yesterday =
VAR _today =
TODAY ()
VAR _yesterdayexceptweekends =
MAXX (
FILTER (
'DIM_Calendar',
'DIM_Calendar'[Date] < _today
&& 'DIM_Calendar'[Weekdayname] <> "Saturday"
&& 'DIM_Calendar'[Weekdayname] <> "Sunday"
),
'DIM_Calendar'[Date]
)
RETURN
CALCULATE (
DISTINCTCOUNT ( 'INSPECTION LOTS DATA - Header'[Inspection lot] ),
ALL ( 'INSPECTION LOTS DATA - Header'[UD Code] ),
USERELATIONSHIP ( 'DIM_Calendar'[Date], 'INSPECTION LOTS DATA - Header'[UD code date] ),
'DIM_Calendar'[Date] = _yesterdayexceptweekends,
'INSPECTION LOTS DATA - Header'[UD Code] <> BLANK ()
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |