Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
User | Count |
---|---|
94 | |
90 | |
79 | |
77 | |
71 |
User | Count |
---|---|
119 | |
105 | |
90 | |
64 | |
63 |