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.
Hi,
Goal is to show employees hrs worked from the first week where they have worked onwards.
Desired Output Matrix Column Headings are the 1st, 2nd instance etc that they worked in a given Week.
Every Employee has a 1st Wk Hrs Worked value but may not have values subsequently.
I have this measure that gives a running total of the number of weeks in which they have worked.
Data -> https://1drv.ms/x/s!AiX0_cACeSxJgSw4iLbtYaaP5nWt?e=vFYNb2
Solved! Go to Solution.
You can use the new INDEX function, but you need to make sure that the ORDERBY column is consistent - some of the values have a space between the Wk and the number, some don't.
First week =
CALCULATE(
SUM( 'Table'[Hrs Worked]),
INDEX( 1,, ORDERBY( 'Table'[Week & Year] ), KEEP, PARTITIONBY( 'Table'[Employee_id] ) )
)
You would need to replicate this measure for subsequent weeks, just change the 1 to 2, 3 etc. Or you could put it into a calculation group.
You can use the new INDEX function, but you need to make sure that the ORDERBY column is consistent - some of the values have a space between the Wk and the number, some don't.
First week =
CALCULATE(
SUM( 'Table'[Hrs Worked]),
INDEX( 1,, ORDERBY( 'Table'[Week & Year] ), KEEP, PARTITIONBY( 'Table'[Employee_id] ) )
)
You would need to replicate this measure for subsequent weeks, just change the 1 to 2, 3 etc. Or you could put it into a calculation group.
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 |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |