Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a matrix visual shows the country as rows, segments as column and the grandtotal. I need to add one more column beside total as total %. I dont need to add % for all the segments only as a column beside grandtotal. Below is the visual
I need to add % as a seperate column as a last column in the matrix. If I create a measure and add it, it is adding for all segments I dont need that to all the segments. I need both total and % columns at the end.
Can anyone help on this or any suggestion or workaround?
Thanks
Sri
Solved! Go to Solution.
Hi @SriBhaskar ,
Thanks for reaching out to the Microsoft fabric community forum.
when you add a measure to calculate the percentage, Power BI applies it to all columns (segments), not just to the total column. But with a little workaround using DAX, you can show a separate % Total column right next to the Total column without showing it for each segment.
Please follow the below steps:
Creating a measure that calculates the % of Total. Using a custom column layout (via field parameters or calculated groups with tabular editor if needed). Or the simpler way: manually arranging a second matrix to appear beside the first one (less dynamic but visually works).
By Using DAX (For a Separate % Column):
Step 1: Create the % Total Measure
% of Total =
DIVIDE(
[Sum of Units Sold],
CALCULATE([Sum of Units Sold], ALL('YourTable'[Country]))
)
Replace [Sum of Units Sold] and 'YourTable' with your actual measure/table names.
Step 2: Use This Measure in Matrix
Now to only show it in the Total column, you can try using a DAX trick to blank out values unless it's the total row (this works depending on layout):
% of Total Only in Total Column =
IF(
HASONEVALUE('Segment'[Segment]),
BLANK(),
[% of Total]
)
This tells Power BI: If you're inside a specific Segment (i.e., not the total column), then don't show anything. Only show value when it's not filtered by a Segment → i.e., the Grand Total column.
Step 3: Add This Measure to the Matrix
Now drag this measure into the Values field after the Sum of Units Sold.
Sample Output:
| Canada | Channel | Enterprise | ... | Total | % of Total |
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @SriBhaskar ,
Thanks for reaching out to the Microsoft fabric community forum.
when you add a measure to calculate the percentage, Power BI applies it to all columns (segments), not just to the total column. But with a little workaround using DAX, you can show a separate % Total column right next to the Total column without showing it for each segment.
Please follow the below steps:
Creating a measure that calculates the % of Total. Using a custom column layout (via field parameters or calculated groups with tabular editor if needed). Or the simpler way: manually arranging a second matrix to appear beside the first one (less dynamic but visually works).
By Using DAX (For a Separate % Column):
Step 1: Create the % Total Measure
% of Total =
DIVIDE(
[Sum of Units Sold],
CALCULATE([Sum of Units Sold], ALL('YourTable'[Country]))
)
Replace [Sum of Units Sold] and 'YourTable' with your actual measure/table names.
Step 2: Use This Measure in Matrix
Now to only show it in the Total column, you can try using a DAX trick to blank out values unless it's the total row (this works depending on layout):
% of Total Only in Total Column =
IF(
HASONEVALUE('Segment'[Segment]),
BLANK(),
[% of Total]
)
This tells Power BI: If you're inside a specific Segment (i.e., not the total column), then don't show anything. Only show value when it's not filtered by a Segment → i.e., the Grand Total column.
Step 3: Add This Measure to the Matrix
Now drag this measure into the Values field after the Sum of Units Sold.
Sample Output:
| Canada | Channel | Enterprise | ... | Total | % of Total |
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @SriBhaskar ,
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @SriBhaskar ,
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Hi @SriBhaskar ,
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
@SriBhaskar Hi!
Try with calculate a separated table as:
Segment Plus =
UNION (
VALUES('Segments'[Segment]),
ROW("Segment", "Total %")
)
Use SegmentPlus as your column in the matrix.
Now create a measure like:
Matrix Value =
SWITCH (
SELECTEDVALUE('Segment Plus'[Segment]),
"Total %",
DIVIDE(
[Sum of Units Sold],
CALCULATE([Sum of Units Sold], ALLSELECTED('YourTable'[Country]))
),
[Sum of Units Sold]
)
Use this measure as Values in the matrix.
Your matrix will show:
Segments as usual (Channel Partners, Enterprise, etc.)
Grand Total (auto-calculated by matrix)
One extra column at the end called "Total %" showing each country’s % of the overall total.
BBF
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |