The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |