The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a table that looks at exams statuses by users:
User | Test | Passed |
A | Z | 1 |
A | X | |
A | Y | 1 |
A | W | 1 |
B | Y | 1 |
B | W | |
B | Z | 1 |
C | Z | 1 |
C | W | |
C | X | 1 |
D | W | |
D | Z | 1 |
E | Y | 1 |
E | W | 1 |
F | X | 1 |
F | Z |
I have a measure that calculates % Passed for each user:
% Passed = DIVIDE(SUM([Passed]), COUNT('Table'[Test]), 0)
I need to tag each user as having "bad results" (with a % Passed < 60%) or "good results" (with a % Passed >= 60%).
I already have a working solution where I am creating a new table with SUMMARIZE to get the aggregate results for users:
Table:
Results =
SUMMARIZE (
FILTER ( 'Table','Table'[User] <> BLANK () ),
'Table'[User],
"Result", [% Passed])
Column:
Results = IF([Result]>=0.6, "Good", "Bad")
Any ideas how I can do that?
Solved! Go to Solution.
Hi @Chris2016 possible solution "in table": please create 4 calculated column (or less if you want to combine some steps), ajdust Sheet1 to your Table name.
Did I answer correctly? Kudos appreciate / accept solution.
Overview
Proud to be a Super User!
Thanks,
I put the it all in a single column:
Result =
var SumPerUser =
CALCULATE(
SUM(MyTable[Passed]),
ALLEXCEPT(MyTable,MyTable[User])
)
var CountPerUser =
CALCULATE(
COUNT(MyTable[User]),
ALLEXCEPT(MyTable,MyTable[User])
)
var perc= DIVIDE(SumPerUser,CountPerUser,0)
return if (perc < 0.6, "Bad", "Good")
Many thanks for your help!
Hi @Chris2016 possible solution "in table": please create 4 calculated column (or less if you want to combine some steps), ajdust Sheet1 to your Table name.
Did I answer correctly? Kudos appreciate / accept solution.
Overview
Proud to be a Super User!
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
10 | |
8 |