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

DAX to display measure values as per multiple values selected on a slicer

Hello brilliant community,

 

I need help to figure out how can I display measure values as per slicer selections: Here is my case-

 

'Category' is the report slicer.  If 'A' & 'B' are selected then measure 'Score of A& B' should display calculated values but 'Score of A&C' should display blank or zero. Similarly If 'A' & 'C' are selected then measure 'Score of A&C' should display calculated values but 'Score of A&B' should display blank or zero.

 

 

Category 
  
A 
B 
C 
  
  
Score of A & BScore of A & C
58
69
70
2310

 

Thanks in advance.

Meena

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: DAX to display measure values as per multiple values selected on a slicer

Hi @Meena ,

 

To create a measure as below.

 

Measure = var _sele = CONCATENATEX(category,category[Category],"&")
return
if(_sele="A&B",[Score of A & B],if(_sele = "A&C",[Score of A & C]))

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Nishantjain Member
Member

Re: DAX to display measure values as per slicer selection

Hi

Use the Switch function to create a new measure. Check the link below

https://www.fourmoo.com/2017/11/21/power-bi-using-a-slicer-to-show-different-measures/

Thanks
Meena Frequent Visitor
Frequent Visitor

Re: DAX to display measure values as per slicer selection

Thanks for the link @Nishantjain . It works if only one value is selected on the slicer,  my requirement is multiple values selection on the slicer. Any suggestions?

 

Thanks,

Meena 

Community Support Team
Community Support Team

Re: DAX to display measure values as per multiple values selected on a slicer

Hi @Meena ,

 

To create a measure as below.

 

Measure = var _sele = CONCATENATEX(category,category[Category],"&")
return
if(_sele="A&B",[Score of A & B],if(_sele = "A&C",[Score of A & C]))

Regards,

Frank

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

Re: DAX to display measure values as per multiple values selected on a slicer

@v-frfei-msftworks perfectly!! Thanks heaps Smiley Happy