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
bsas
Post Patron
Post Patron

Show different values in chart based on 3 conditions (2 slicer and all) in Stacked Bar Chart

Hello PBI Experts,

 

I have intersting challenge... how to show different values in Stacked Bar Chart based on values from slicer on values from another field (<> slicer list):

 

For example: I have slicer (field) with list of people and have a field with another list of people (totally different people).

Can I somehow show if slicer is selected = person from slicer if nothing selected list of people from "another" field.

 

I'd treid to use something like:

 

slicer4 = SWITCH(
	         TRUE(),
		CALCULATE(DISTINCTCOUNT('Opp-ty'[ss_projectmanageridname]),
ALLSELECTED('Opp-ty'[ss_projectmanageridname]))>1,
'Opp-ty'[ss_projectmanageridname],'Opp-ty'[Owner])

or

 

test_slicer3 = IF(ISFILTERED('Opp-ty'[ss_projectmanageridname]) 
&& DISTINCTCOUNT('Opp-ty'[ss_projectmanageridname])=1,
'Opp-ty'[ss_projectmanageridname],'Opp-ty'[Owner])

These are calculated columns (measures can't be used in field "Axis" on Stacked Bar Chart. The problem is that these cc show only person from slicer or all persons from "another field". 

 

Maybe someone faced with such issue?

 

Simple data fields:

Person1Person2money
Mariya Andriy10000
PetroOleh20000
Roman Andriy150000
Sergii Andriy3000
 OksanaOleh70000
4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@bsas,

 

Instead, you may drag both columns to Axis, and click the second icon "Go to the next level in the hierarchy" in the top left corner of the visualization.

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

Thanks @v-chuncz-msft but this is not what I need.

@bsas,

 

Another way is to select Unpivot Columns in Query Editor.

https://community.powerbi.com/t5/Desktop/multiple-variables-graph-filter/td-p/239301

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

Thanks @v-chuncz-msft will try to use this tomorrow.

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.