cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KrishnaGSK Frequent Visitor
Frequent Visitor

How to bring Multiple Measures in a single slicer

Hi all,

1.         I have created below measure to keep multiple measures in one slicer. Both are getting the same result.

PP_MetricPicker =
SWITCH(TRUE(),
SELECTEDVALUE(Slicer_MetricPP[PP_MetricPicker])= "Consumption Dollars % Change vs PP",[Consumption Dollars % Change vs PP],
SELECTEDVALUE(Slicer_MetricPP[PP_MetricPicker])= "Consumption Units % Change vs PP",[Consumption Units % Change vs PP],
BLANK()
)

 

IF(
SELECTEDVALUE(Slicer_MetricPP[PP_MetricPicker])= "Consumption Dollars % Change vs PP",[Consumption Dollars % Change vs PP],
IF(SELECTEDVALUE(Slicer_MetricPP[PP_MetricPicker])= "Consumption Units % Change vs PP",[Consumption Units % Change vs PP],
BLANK()
))

 

2. To create this measures 1st i have created a table 'Slicer_MetricPP' as below. Based on this i have created the measure.

3.PNG

 3. After creating the measure i have created a line chart by keeping the measure in values and Month-Year in Axis.

     and i have created a slicer on the table which i have created.

    Its working perfect when i click on single select in the slicer as below

1.png

 

But when i select both its showing nothing as below. 

 2.PNG

I guess switch and If functions will bring only one value when we use them in a slicer.

 

My requirement is to show up the two measures at a time when i select them in slicer.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User II
Super User II

Re: How to bring Multiple Measures in a single slicer

SELECTEDVALUE returns the alternate result (BLANK by default) when selecting more than one value
I think in ordet to make it work you would need to add the Slicer_MetricPP[PP_MetricPicker] column as a series in the  chart, so it would display the measures in different colours - that should limit the filter context to single value again

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Datanaut!

View solution in original post

Community Support Team
Community Support Team

Re: How to bring Multiple Measures in a single slicer

HI @KrishnaGSK ,

As Stachu said, by default SELECTEDVALUE function no suitable to deal with summary records(you haven't added any category fields to group measures, for this line chart, each point of the line graph contains all measure types) and it returns blank if you selected multiple values in the slicer.  
For this scenario, you can consider adding your measure slicer field to legends field of line chart, then your formula can be grouped by its legends and splitting to multiple graphs based on different legend labels.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: How to bring Multiple Measures in a single slicer

SELECTEDVALUE returns the alternate result (BLANK by default) when selecting more than one value
I think in ordet to make it work you would need to add the Slicer_MetricPP[PP_MetricPicker] column as a series in the  chart, so it would display the measures in different colours - that should limit the filter context to single value again

Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Datanaut!

View solution in original post

Community Support Team
Community Support Team

Re: How to bring Multiple Measures in a single slicer

HI @KrishnaGSK ,

As Stachu said, by default SELECTEDVALUE function no suitable to deal with summary records(you haven't added any category fields to group measures, for this line chart, each point of the line graph contains all measure types) and it returns blank if you selected multiple values in the slicer.  
For this scenario, you can consider adding your measure slicer field to legends field of line chart, then your formula can be grouped by its legends and splitting to multiple graphs based on different legend labels.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors