Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |