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.
Scenario:
I have a matrix with the type of time entry various staff make against various time codes.
I want to calculate the % of time entered in, say, Time Codes 2 and 3
Example:
Alex Bob Chi Dave
Time Code 1 1 1 3
Time Code 2 2 1 3
Time Code 3 2 2 1
Time Code 4 1 1 3 2
Time Code 5 2 2 2
TOTAL 6 6 8 8
% of TC 2/3 33% 50% 25% 50%
Note that this Matrix is already a summary of time entered acorss a variable date field, so an an entry is already summing entries to that time code for the filtered date range.
I have NO IDEA how to even begin doing this!
HEELP!
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
You need convert the format of Hour to whole number, and then use the measures:
Measure = CALCULATE(SUM('Table'[Hour]),ALLEXCEPT('Table','Table'[Code],'Table'[Name]))
Measure 2 = CALCULATE(SUM('Table'[Hour]),FILTER(ALL('Table'),[Code]="TC 2"||[Code]="TC 3"),VALUES('Table'[Name]))
Measure 3 = CALCULATE(DIVIDE([Measure 2],[Measure]),ALLEXCEPT('Table','Table'[Name]))
Hi @Anonymous ,
You can add the calculated column:
Total = [Time Code 1]+[Time Code 2]+[Time Code 3]+[Time Code 4]+[Time Code 5]
% of TC 2/3 = DIVIDE([Time Code 2]+[Time Code 3],[Total])
Then put it on values:
Pbix attached.
Thank you, I appreciate your help in this.
Unfortunately, my data is laid out differntly, and I apologise for not being mor clear.
The underlying data table looks like this:
Name Code Hours
Alex TC 1 1
Alex TC 2 1
Alex TC 5 1
Alex TC 4 1
Alex TC 2 1
Alex TC 1 1
Alex TC 2 1
Alex TC 5 1
Bob TC 1 1
Bob TC 2 1
etc....
So I can't add the TC values as they are type string.
Thanks!
Hi @Anonymous ,
You need convert the format of Hour to whole number, and then use the measures:
Measure = CALCULATE(SUM('Table'[Hour]),ALLEXCEPT('Table','Table'[Code],'Table'[Name]))
Measure 2 = CALCULATE(SUM('Table'[Hour]),FILTER(ALL('Table'),[Code]="TC 2"||[Code]="TC 3"),VALUES('Table'[Name]))
Measure 3 = CALCULATE(DIVIDE([Measure 2],[Measure]),ALLEXCEPT('Table','Table'[Name]))
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 |
---|---|
108 | |
98 | |
79 | |
67 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |