Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I have a table in which Column A has some values and I am trying to calculate percentage as shown in below table:
Column A |
abc |
abc |
xyz |
xyz |
abc |
abc |
Percentage | |
abc | xyz |
66.66% | 33.33% |
Is there any query that can give me the percentage as shown above?
Solved! Go to Solution.
(1)Create a column to count the number of category .
column A num = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Column A]))
(2)Create a column to count the number of the table
whole num = COUNTROWS('Table')
(3)Create a column to count the percentage
percentage = 'Table'[column A num]/'Table'[whole num]
Then add a Matrix visual and put Column A into Columns ,put percentage into Values .
The final result is as shown :
I have attached my pbix file ,you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
(1)Create a column to count the number of category .
column A num = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Column A]))
(2)Create a column to count the number of the table
whole num = COUNTROWS('Table')
(3)Create a column to count the percentage
percentage = 'Table'[column A num]/'Table'[whole num]
Then add a Matrix visual and put Column A into Columns ,put percentage into Values .
The final result is as shown :
I have attached my pbix file ,you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Pooja_Mishra , Create a measure like
percent = divide( countrows(Table), calculate( countrows(Table), allselected(Table)))
// mark as % in measure tool
In matrix , Enable : Show on row
Use column on Column of matrix. Nothing on row
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
69 |
User | Count |
---|---|
114 | |
97 | |
97 | |
73 | |
72 |