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.
Good Afternoon All,
I am creating a dynamic Top N report to capture Overtime Hours by Employee at different facilities.
I have the following Slicers: PayWeek, Facility, and my Top N Selector.
I am not sure how to proceed at this point. Based on the Slicer Selections, I need to populate a bar chart.
Daily data is stored in a Fact table called OTStats.
For each Employee, I will need to Sum OT Hours for each day of the PayWeek selected (multiple weeks are allowed).
I think I need to create some sort of table (virtual or actual), but am stuck. Any guidance would be very much appreciated.
Solved! Go to Solution.
I am assuming you have a measure to sum the OT Hours, in my example that is [OT Hours]. Then you would use something like this:
Top N OT Employees =
VAR _SelectedN =
SELECTEDVALUE ( 'Select Top N'[Top N Value], 10 )
RETURN
CALCULATE (
[OT Hours],
KEEPFILTERS( TOPN ( _SelectedN, ALL ( 'YourTable'[Employee Name] ), [OT Hours] ) )
)
I am assuming you have a measure to sum the OT Hours, in my example that is [OT Hours]. Then you would use something like this:
Top N OT Employees =
VAR _SelectedN =
SELECTEDVALUE ( 'Select Top N'[Top N Value], 10 )
RETURN
CALCULATE (
[OT Hours],
KEEPFILTERS( TOPN ( _SelectedN, ALL ( 'YourTable'[Employee Name] ), [OT Hours] ) )
)
Hello @jdbuchanan71 ,
Thank You for the quick response!
Pretty sure that looks like the answer I was looking for!
Thanks again and of course Kudos to you.
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 |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |