Forum Discussion
% Calculations in Power BI
I am not sure why this is so hard. I tried using quick measures but I am getting nowhere.
This first report here I want to create a column (I think?) that gives me the % of closed. So there is 306 tickets and 165 are closed so I would I shoud see 54%.
For this report I have the closed tickets from the previous report and I want to do a % of the types of closure reasons from the total number of the tickets. So I would expect to see 83% resolved, 16% Declined and 1% Declined - Too Old to Fix. Keeping in mind that we may add more closure reasons down the line.
8 Replies
- amitchandak
Super User
AmberJane , if you want show % of total in table for measure M1
You can try
divide([M1], calculate([M1], allselected())
% of closed at GT level
divide(calculate([M1], filter(Table, Table[Item Status] ="Closed")),calculate([M1], allselected())
or
divide(calculate([M1], filter(Table, Table[Item Status] ="Closed")), [M1])
- AmberJane
Helper III
Hello, I am playing around with this but not sure what M1 would be in the calculation? Nothing is autopopulating.
- AmberJane
Helper III
I may have figured it out. Stand by! haha
- AmberJane
Helper III
Ok I was able to get the first report working using the calculation you provided. See screenshot below! However, the second report I am still stuck on.
For this report I have the closed tickets from the previous report and I want to do a % of the types of closure reasons from the total number of the closed tickets. So I would expect to see 83% resolved, 16% Declined and 1% Declined - Too Old to Fix.
- AnonymousNot applicable
Hi AmberJane,
Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
- AnonymousNot applicable
Hi,
I think you should be using a calculated measure instead of a calculated column because both of these have a different method of calculation.
Calculated columns perform calculations at row level and calculated measures perform calculations at an aggregated level which is suitable for percentage calculations.
Here's a mathematical description of the above statement.