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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rsbin
Super User
Super User

Change from Stacked Bar Chart to 100% Stacked Bar using a Slicer

Good Day,

I have the requirement to change from a Stacked Bar visual (SUM of Items) to 100% Stacked Bar visual.

rsbin_0-1634835598822.png

EquipmentID_Count = SUM( GeneralStatistics[Total_EquipmentIDCount] )

 

rsbin_1-1634835650319.png

I know I can do this via buttons and bookmarks, but for this specific application, my User Group is asking for this to be done via a Slicer Selection (i.e. Select Value or Select % ).   Any ideas would be most appreciated.

 

Thanks and regards,

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @rsbin ,

 

You could do this by using stacked bar chart.

Step1:

Create a table like below and use it as slicer.

Capture.PNG

Step2:

Create two measures(simple measures as a demonstration).

_sum = SUM('Table'[value])

_percent = SUM('Table'[value])/CALCULATE(SUM('Table'[value]),ALL('Table'))

Step3:

Create another measure and put it in the visual.

_switch = IF(SELECTEDVALUE(slicer[slicer]) = "sum",slicer[_sum], [_percent])

 

1.PNG

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @rsbin ,

 

You could do this by using stacked bar chart.

Step1:

Create a table like below and use it as slicer.

Capture.PNG

Step2:

Create two measures(simple measures as a demonstration).

_sum = SUM('Table'[value])

_percent = SUM('Table'[value])/CALCULATE(SUM('Table'[value]),ALL('Table'))

Step3:

Create another measure and put it in the visual.

_switch = IF(SELECTEDVALUE(slicer[slicer]) = "sum",slicer[_sum], [_percent])

 

1.PNG

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@rsbin , You can change measure in visual using measure slicer. But you can not do the same for axis or visual type.

 

measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...

 

 

You can create a measure like 

divide([measure], calculate([Measure], removefilter(Table[Legend]))  )

 

replace Legend with Legend column and measure with your measure to get % of  subtotal

 

Percent of SubTotal or Total: https://www.youtube.com/watch?v=6jTildcV2ho&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=37

Hello @amitchandak,

Thanks much for the reply.  I will review the links and see if I can make something work for me.

Appreciate your time.

Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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