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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Saswa_D
Frequent Visitor

combining three measures into a single measure for matrix visual

Hi,

I have created 3 measures for calculating percentage for 3 different sentiments as below.

Saswa_D_0-1657449343400.png

This seems to be working fine and in matrix I can show them as below

Saswa_D_1-1657449402486.png

However this appears as 3 different columns, however I want to show it in a single column like below:

Saswa_D_2-1657449487554.png

In a single bar I want to show positive,negative,neutral
Any help or guidance would be really appreciated 

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@Saswa_D just create this measure:
% of all selected = 
DIVIDE(COUNT(Sentiment[overall sentiment]), CALCUALTE(COUNT(Sentiment[overall sentiment]), ALLSELECTED(Sentiment[overall sentiment]))

Put it in a stacked bar chart and the [overall sentiment] column in the lengend.


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

5 REPLIES 5
SpartaBI
Community Champion
Community Champion

@Saswa_D just create this measure:
% of all selected = 
DIVIDE(COUNT(Sentiment[overall sentiment]), CALCUALTE(COUNT(Sentiment[overall sentiment]), ALLSELECTED(Sentiment[overall sentiment]))

Put it in a stacked bar chart and the [overall sentiment] column in the lengend.


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Thank You, this works as a separate visual but do we have any trick to make it work in matrix visual like for each row I can show a single bar in matrix or if in table visual.

Saswa_D_0-1657452624022.png

Right now it shows up in 3 different columns in matrix visual

SpartaBI
Community Champion
Community Champion

@Saswa_D the regular matrix / table can't do that. They have the sparkline feature but it's not that rich to be able to do a stacked bar chart with legend. Maybe there is a custom visual that does that, but not something I'm aware of.

That helps, Thank You very much. I would still accept the above stacked bar solution since it does our work though in separate visual

SpartaBI
Community Champion
Community Champion

@Saswa_D great :))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.