Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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:
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_DATE | Statistics | VALUE |
| 2018 | Actual incidents | 54492 |
| 2018 | Cleared otherwise | 8233 |
| 2018 | Total cleared | 24674 |
| 2019 | Actual incidents | 3 |
| 2019 | Actual incidents | 3052 |
| 2019 | Cleared otherwise | 524 |
| 2019 | Total cleared | 1404 |
| 2019 | Actual incidents | 17 |
| 2019 | Actual incidents | 8108 |
| 2019 | Cleared otherwise | 850 |
| 2019 | Total cleared | 1754 |
| 2019 | Actual incidents | 2608 |
| 2019 | Total cleared | 169 |
Expected Output
| Year | Actual | Cleared | % Percentage |
| 2018 | 1195 | 563 | 0.47113 |
| 2019 | 1236 | 1002 | 0.81068 |
Any help or suggestions would be highly appreciated. Thank you in advance for your assistance!
Solved! Go to Solution.
i totally got you .
result :
what you can do is used power query to pivot your table like this :
steps :
1.select statistics columm
2. go to transform --> pivot
3. set the below configuration
4. you will ahve the following strucutre:
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.
i totally got you .
result :
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 23 |