Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
0Experience
Helper III
Helper III

How to Calculate Percentage of 2 columns from Matrix Table

Hello everyone,

 

I hope this message finds you well. I am relatively new to Power BI, and I have a question that may seem quite basic, for which I apologize in advance.

 

In my original data table, I have several columns, and in one particular column (Statistics), there are multiple values such as "Actual," "Total Cleared," etc.

 

I am currently working on a Table Matrix, where I have placed the Year in the rows and Statistics in the columns. The values for the Statistics are sourced from the Value column in my dataset. After setting this up, the table matrix looks like the following:

 

0Experience_0-1706026121435.png

 

 

Now, my goal is to calculate the percentage of "Actual" and "Total Cleared" from the matrix table (Total/Actual). After conducting some research and web surfing, it seems I might need to use DAX to create a new column with the percentage.

 

However, I'm facing a challenge since "Actual" and "Total Cleared" are not direct columns in my Data table; they are part of the Statistics column.

 

Dummy data added with the post

REF_DATEStatisticsVALUE
2018Actual incidents54492
2018Cleared otherwise8233
2018Total cleared24674
2019Actual incidents3
2019Actual incidents3052
2019Cleared otherwise524
2019Total cleared1404
2019Actual incidents17
2019Actual incidents8108
2019Cleared otherwise850
2019Total cleared1754
2019Actual incidents2608
2019Total cleared169

 

Expected Output

YearActualCleared% Percentage
201811955630.47113
2019123610020.81068

 

Any help or suggestions would be highly appreciated. Thank you in advance for your assistance!

1 ACCEPTED SOLUTION

@0Experience 

i totally got you . 

result : 

Daniel29195_0-1706122234639.png

 

 

Daniel29195_1-1706122242205.png

actual =
CALCULATE(
    SUM(table11[VALUE]),
    table11[Statistics] = "Actual Incidents"
)
 
 
 
Daniel29195_2-1706122270841.png

 

Total =
CALCULATE(
    SUM(table11[VALUE]),
    table11[Statistics] = "Total cleared"
)
 
 
 
Daniel29195_4-1706122284270.png
% =
DIVIDE(
    [Total],
    [actual]
    ,0
)
 
final result 
Daniel29195_0-1706122234639.png
 
let me know if this helps 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

View solution in original post

6 REPLIES 6
Daniel29195
Super User
Super User

@0Experience 

 

what you can do is used power query to pivot your table like this : 

Daniel29195_0-1706030645061.png

steps : 

 

1.select statistics columm 

2. go to transform --> pivot  

Daniel29195_1-1706030679471.png

 

3. set the below configuration

Daniel29195_2-1706030698347.png

 

 

4.  you will ahve the following strucutre:

Daniel29195_3-1706030720976.png

 

 

 

now you can use measure : sum( actual_column) / sum(total_cleared) 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

 

@Daniel29195, thanks for your answer, and it should work. However, in here, I used dummy data (a very small portion of my main dataset). My main dataset has many columns, and in the Statistics column, I have numerous items. So if I transpose the Statistics column for the table, it will mess up the whole table and other visualizations I already have in the dashboard.

 

Without transposing the entire table, is there any other option, please?

 

Thank you.

@0Experience 

i totally got you . 

result : 

Daniel29195_0-1706122234639.png

 

 

Daniel29195_1-1706122242205.png

actual =
CALCULATE(
    SUM(table11[VALUE]),
    table11[Statistics] = "Actual Incidents"
)
 
 
 
Daniel29195_2-1706122270841.png

 

Total =
CALCULATE(
    SUM(table11[VALUE]),
    table11[Statistics] = "Total cleared"
)
 
 
 
Daniel29195_4-1706122284270.png
% =
DIVIDE(
    [Total],
    [actual]
    ,0
)
 
final result 
Daniel29195_0-1706122234639.png
 
let me know if this helps 
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

Thanks @Daniel29195 

Ritaf1983
Super User
Super User

Hi @0Experience 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

@Ritaf1983 thanks for your reply. I added some summy data, and expected output format.

 

Thanks again

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.