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 Everyone,
I'm trying to calculate a percentage. My column consists of YES, NO and NA. What i want to calculate is just NO/(YES + NO).
How can i do this in PowerBI?
Thank you!
Solved! Go to Solution.
Hi @DataAnalyst13 , Try this:
Result = var count_of_NO = Calculate(count([columnname]), FILTER(tablename, [columnname]="NO"))
var count_of_YES = Calculate(count([columnname]), FILTER(tablename, [columnname]="YES"))
var total =count_of_NO + count_of_YES
RETURN
DIVIDE(count_of_NO, total)
If you wish to include NA too in the toal then you can use this:
var total = count([columnname])
@DataAnalyst13 -> Please hit the thumbs up & mark it as a solution if it helps you. Thank you.
Hi @DataAnalyst13 , Try this:
Result = var count_of_NO = Calculate(count([columnname]), FILTER(tablename, [columnname]="NO"))
var count_of_YES = Calculate(count([columnname]), FILTER(tablename, [columnname]="YES"))
var total =count_of_NO + count_of_YES
RETURN
DIVIDE(count_of_NO, total)
If you wish to include NA too in the toal then you can use this:
var total = count([columnname])
@DataAnalyst13 -> Please hit the thumbs up & mark it as a solution if it helps you. Thank you.
divide(calculate(count(Table[column]), filter(Table, Table[flag] in {"Yes", "No"})) ,
calculate(count(Table[column]), filter(allselected(Table), Table[flag] in {"Yes", "No"})) )
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 |
---|---|
105 | |
96 | |
75 | |
63 | |
62 |
User | Count |
---|---|
135 | |
105 | |
104 | |
80 | |
65 |