Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have a column of data that counts orders by employee, and another that counts if the order has been completed. I created a measure that calculates the completion rate and dropped all this in a matrix which accurately calculates for each level in the org hierarchy (employee, leader, 2nd level, department, etc). Data is dynamic based on the selected dates in the slicer.
I want another measure that calculates the % of teams that are at or above a specific completion rate goal in the same matrix. At the employee level it would just be blank, but the next level up would calculate based on each individual employee >= goal / total employees in that grouping. How do you get the DAX to calculate the condition for each item within the current grouping?
PB Desktop January 2022 is the current version I'm allowed to work in. Below is a simplistic illustration of what I'm trying to accomplish (but I'd be doing that for 6 levels of hierarchy). In excel I would probably use SUMPRODUCT, but in DAX/PBI to count the number of teams it might be a combination of ISINSCOPE and some sort of count unique, then do the same thing adding on the conditional calculation.
ORG LEVEL | ITEMS | COMPLETED | Complete rate (comp/items) | teams at >= 50% | %of teams >= 50% |
Department | 38 | 16 | 42% | 3 | =3 / 5 employees in dept |
Leader 1A | 13 | 7 | 53% | 2 | =2 / 2 employees in team |
Emp 11A | 10 | 5 | 50% | group row1 | |
Emp 21A | 3 | 2 | 66% | group row1 | |
Leader 2A | 5 | 1 | 20% | 0 | =0 / 1 employee in team |
Emp 12A | 5 | 1 | 20% | group row2 | |
Leader 3A | 20 | 8 | 40% | 1 | =1 / 2 employees in team |
Emp 13A | 15 | 5 | 33% | group row3 | |
Emp 23A | 5 | 3 | 60% | group row3 | |
Solved! Go to Solution.
Hi, @Brian_Hunt ;
You could create measures as follow:
teams at >50% = CALCULATE(COUNT('Table'[Level3]),FILTER('Table',[Complete rate]>=0.5))
of teams >50% =
IF(ISINSCOPE('Table'[Level3]),BLANK(),
[teams at >50%]/COUNT('Table'[Level3]))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Brian_Hunt ;
You could create measures as follow:
teams at >50% = CALCULATE(COUNT('Table'[Level3]),FILTER('Table',[Complete rate]>=0.5))
of teams >50% =
IF(ISINSCOPE('Table'[Level3]),BLANK(),
[teams at >50%]/COUNT('Table'[Level3]))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi
I think
measure
%team =
var count_employee = DISTINCTCOUNT (employee)
var count_employee>50% = CALCULATE ( COUNTROW(SUMMARIZE (date,employee)), COMPLETE rate >=50%)
var group/department = SELECTEDVALUE (employee)
return
if ( group/department <> blank (), blank (), count_employee>50% / count_employee)
This is a huge step towards what I'm trying to accomplish. I was getting a DAX error " A function 'PLACEHOLDER' has been used..." and had to switch the 2nd var to add FILTER to the CALCULATE in order to use the aformentioned measure:
CALCULATE ( COUNTROWS(SUMMARIZE (date,employee)),FILTER(table1,CompleteRate >= 50%)
Unfortunately the percentages were not what I was expecting. I then used SUMMARIZE to create a table to see what it was actually doing, and broke otu the distinct count, and row count >50% to compare data. I managed to the get whole number counts of distinct employee and employee > 50 to add up, but the [>50] / [distinct count] was Summing the individual row percentages rather than recalculating at the hierarchy level above. I'll play around with summarize some more to find the disconnect.
Dear,
Can you share your file to see detail
Unfortunately my organization doesn't allow the uploading of any contents to this site, despite being connected to login via windows authentication. I can't even upload a picture of the layout or structure which is why I had to create the ugly comment table.
The info you've given me so far has leaped me several steps forward in just being able to summarize and calculate off an already calculated measure.
Thank you. I'll give this a try and let you know.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
93 | |
85 | |
84 | |
73 | |
49 |
User | Count |
---|---|
142 | |
133 | |
110 | |
68 | |
55 |