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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
738o51
Helper II
Helper II

Change column value in chart visual using slicer

Hi PBI community,

 

I'm hoping you can help me solve a problem. 

 

As shown in the pbix here: https://www.dropbox.com/s/owfkp1lqdwcusqo/Candlestick%20Question.pbix?dl=0

I have two bar graph visuals (or candlestick charts in this case) where I need to use columns as my fields in the visualization tab. As it stands, I can filter by location, but I cannot figure a way to filter by type A and type B. This would involve being able to dynamically switch between columns fields using slicers, while ensuring that the right columns go into the correct fields (e.g., I have two options for open that should only go into the open field).

 

Can anyone help so that I can show all the information in one graph, with a slicer for building, and for Type A/B?

 

1 ACCEPTED SOLUTION
AiolosZhao
Memorable Member
Memorable Member

Hi @738o51 ,

 

1. Created a new table with a column named "slicer" like the below screenshot with 2 values "AAA' and "BBB".

2. Created 4 measure like below:

Close Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Close])),CALCULATE(SUM('Sample'[B Close])))

High Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A High])),CALCULATE(SUM('Sample'[B High])))

Low Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Low])),CALCULATE(SUM('Sample'[B Low])))

Open Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Open])),CALCULATE(SUM('Sample'[B Open])))

3. Put these 4 measures into the chart, then you will get

Change column value in chart visual using slicer.PNG

Hope this is what you want, please try.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
AiolosZhao
Memorable Member
Memorable Member

Hi @738o51 ,

 

1. Created a new table with a column named "slicer" like the below screenshot with 2 values "AAA' and "BBB".

2. Created 4 measure like below:

Close Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Close])),CALCULATE(SUM('Sample'[B Close])))

High Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A High])),CALCULATE(SUM('Sample'[B High])))

Low Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Low])),CALCULATE(SUM('Sample'[B Low])))

Open Measure = IF(MAX('Table'[Slicer]) = "AAA",CALCULATE(SUM('Sample'[A Open])),CALCULATE(SUM('Sample'[B Open])))

3. Put these 4 measures into the chart, then you will get

Change column value in chart visual using slicer.PNG

Hope this is what you want, please try.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This worked! Thank you so much!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.