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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
flyingmada
Helper I
Helper I

Slicer to change data used on all tables and graphs

I have a table with multiple columns where there are "Raw" or "Cleaned" values. These will represent the same location in each visualization but would like to select between the two with a slicer. When selecting the "Raw" or "Cleaned" slicer option, the connected tables charts will adjust based on the related columns. Example of table is below.

 

PBI example 5.JPG

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@flyingmada - You will have to either do the switching in your measure or you can unpivot the columns. The second approach is generally not recommended for unpivoting measures. In a measure it is something like:

 

Measure =
  VAR __Selection = MAX('Slicer'[Column])
RETURN
  SWITCH(__Selection,
    "Raw",SUM('Table'[Raw]),
    "Clean",SUM('Table'[Clean])
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@flyingmada 

An alternative method is to use bookmarks with buttons. (You can keep the slicer values)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Greg_Deckler
Super User
Super User

@flyingmada - You will have to either do the switching in your measure or you can unpivot the columns. The second approach is generally not recommended for unpivoting measures. In a measure it is something like:

 

Measure =
  VAR __Selection = MAX('Slicer'[Column])
RETURN
  SWITCH(__Selection,
    "Raw",SUM('Table'[Raw]),
    "Clean",SUM('Table'[Clean])
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

What does the

('Slicer'[Column])

in your forumula represent?

Am i referencing the slicer? If so, how do I do this?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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