Forum Discussion
How to add a column in your matrix
I have a table with 2 columns: carCount , carDealer
| carDealer | carCount | type |
| A | 2 | sedan |
| B | 3 | coupe |
| A | 2 | sport |
| A | 3 | coupe |
| B | 2 | sedan |
| B | 5 | sport |
| C | 6 | coupe |
| C | 4 | sedan |
| A | 2 | sedan |
| B | 4 | sport |
| C | 6 | coupe |
| C | 10 | sport |
I created a matrix i power BI, where I want total count of car by type for each dealership. So the result was like this:
| carDealer | sedan | coupe | sport | Total |
| A | 4 | 3 | 2 | 9 |
| B | 2 | 3 | 9 | 14 |
| C | 4 | 12 | 10 | 26 |
I am able to do this, but I want to add one more column which should be: (coupe+sport/Total)*100
How can I add this column here in the matrix.
Hi, shbz1690
Thank you for your feedback.
I did this by using Tabular Editor in Power BI.
I was thinking about how to show it like what you described on the post, but I could only find this way to do it. I think there are many other ways to achieve this but in my case, I could do it in this way only.
First, download the external tool (Tabular Editor) for Power BI, and install it.
In Tabular Editor,
- create a calculation group
- under the calculation group, create calculation items
item1: Sedan
item2: Coupe
item3: Sport
item4: OneMoreColumn
item5: Total
I wrote the DAX measure for each calculation item. Keep in mind that the Total also has to be created.
I could not find a way to draw pictures for each step.
If you are OK, I can show it to you via TEAMS meeting.
Thank you very much.
4 Replies
- Jihwan_Kim
Super User
Hi, shbz1690
Please correct me if I wrongly understood your question.
Please check whether the below picture is what you are looking for.
I have created a Calculation group by using Tabular Editor in Power BI, and add this Calculation Group-Column to the Column-section in matrix visualization.
The link to the sample pbix file is down below.
https://www.dropbox.com/s/7jgpbcnwcsyavxo/shbz1690.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
- shbz1690Frequent Visitor
What you did is correct, can you please let me know the steps so that I can do it in my power BI file.
- Jihwan_Kim
Super User
Hi, shbz1690
Thank you for your feedback.
I did this by using Tabular Editor in Power BI.
I was thinking about how to show it like what you described on the post, but I could only find this way to do it. I think there are many other ways to achieve this but in my case, I could do it in this way only.
First, download the external tool (Tabular Editor) for Power BI, and install it.
In Tabular Editor,
- create a calculation group
- under the calculation group, create calculation items
item1: Sedan
item2: Coupe
item3: Sport
item4: OneMoreColumn
item5: Total
I wrote the DAX measure for each calculation item. Keep in mind that the Total also has to be created.
I could not find a way to draw pictures for each step.
If you are OK, I can show it to you via TEAMS meeting.
Thank you very much.