The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi there,
I have a measure to calculate the occurrence when a shift is longer than 6 hours:
Occurrence = COUNTX (
FILTER (
SUMMARIZECOLUMNS (
Timekeeping_Data[Date],
Timekeeping_Data[SHIFT_ID],
Timekeeping_Data[FirstName],
"shift", DATEDIFF([FistDayStart],[FistBreakStart],MINUTE)/60
),
[shift] > 6
),
Timekeeping_Data[FirstName]
)
It works fine when I put the measure to the card visual and also when I filter the whole page by Timekeeping_Data[Date] but when I want to create the occurrence by date using the bar chart I'm receiving the error:
SummarizeColumns() and AddMissingItems() may not be used in this context.
Could someone help me with modifying the measure to be used in the bar chart per day?
Thanks a lot.
Solved! Go to Solution.
Hi,
I am not sure how your dataset looks like, but please try something like below.
Occurrence =
COUNTX (
FILTER (
ADDCOLUMNS (
SUMMARIZE (
Timekeeping_Data,
Timekeeping_Data[Date],
Timekeeping_Data[SHIFT_ID],
Timekeeping_Data[FirstName]
),
"@shift", CALCULATE ( DATEDIFF ( [FistDayStart], [FistBreakStart], MINUTE ) ) / 60
),
[@shift] > 6
),
Timekeeping_Data[FirstName]
)
Hi,
I am not sure how your dataset looks like, but please try something like below.
Occurrence =
COUNTX (
FILTER (
ADDCOLUMNS (
SUMMARIZE (
Timekeeping_Data,
Timekeeping_Data[Date],
Timekeeping_Data[SHIFT_ID],
Timekeeping_Data[FirstName]
),
"@shift", CALCULATE ( DATEDIFF ( [FistDayStart], [FistBreakStart], MINUTE ) ) / 60
),
[@shift] > 6
),
Timekeeping_Data[FirstName]
)
That's it.
Thanks a lot"
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |