Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have two boolean columns (A and B) which contain 1s and 0s where the other doesn't.
I know it should be simple but I can't figure out how to display the two column totals as a percentage.
It'd be something like A: 40% B:60%.
Thanks
Solved! Go to Solution.
Hi @Class66Loco
Based on your needs, I have created the following table.
You can use the following measure to calculate the percentage of the number 1 in column A and the number 0 in column B.
A% =
VAR Total_Rows = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1)) + CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
VAR Count_A = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1))
RETURN Count_A / Total_Rows
B% =
VAR Total_Rows = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1)) + CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
VAR Count_B = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
RETURN Count_B / Total_Rows
This is the result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Class66Loco
Based on your needs, I have created the following table.
You can use the following measure to calculate the percentage of the number 1 in column A and the number 0 in column B.
A% =
VAR Total_Rows = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1)) + CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
VAR Count_A = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1))
RETURN Count_A / Total_Rows
B% =
VAR Total_Rows = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[A]=1)) + CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
VAR Count_B = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[B]=0))
RETURN Count_B / Total_Rows
This is the result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Class66Loco
Please supply an example of the data. Your description isn't clear enough.
For example, If you have column A and column B, does only one of them contain 1's and the other contain 0's? Do they both contain 1 and 0? The bit where the other doesn't is confusing the issue.
Are there blanks in the columns?
What is the % that you want to measure? The number of 1's and 0's in each against the total number of rows?
Phil
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |