Forum Discussion
Measure not working with calculated column code due to "no single values"
- 3 years ago
Hi, GunnZ
Sample data:You can try the following formula.
Measure:
Workload (h) test = IF ( WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) < 6, CALCULATE ( SUM ( 'Monitoring Demand Input'[Workload (h) per day] ), FILTER ( ALL ( 'Monitoring Demand Input' ), 'Monitoring Demand Input'[Start Date] <= SELECTEDVALUE ( 'Date'[Date] ) && 'Monitoring Demand Input'[End Date] >= SELECTEDVALUE ( 'Date'[Date] ) ) ), 0 )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, GunnZ
Sample data:
You can try the following formula.
Measure:
Workload (h) test =
IF (
WEEKDAY ( SELECTEDVALUE ( 'Date'[Date] ), 2 ) < 6,
CALCULATE (
SUM ( 'Monitoring Demand Input'[Workload (h) per day] ),
FILTER (
ALL ( 'Monitoring Demand Input' ),
'Monitoring Demand Input'[Start Date] <= SELECTEDVALUE ( 'Date'[Date] )
&& 'Monitoring Demand Input'[End Date] >= SELECTEDVALUE ( 'Date'[Date] )
)
),
0
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- GunnZ3 years agoRegular Visitor
Hi Charlotte,
Thank you for the help and showing me SELECTEDVALUE.
However, the filtering is still lost. The sample data has an additonal column called "type".
A slicer doesn't work and if I add the "type" as a legend, it simply duplicates the data:
And a follow-up question: to sum up the workload per week, I would create a second measure to sum up the first correct?