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
BIDev4Life
Frequent Visitor

Fixing Dynamic Measure Slicer

I have built a measure slicer that is working almost as expected.

I started by creating a disconnected table with all of my measures:

BIDev4Life_0-1661435473363.png

I then created measures which reference the table to pick which one is displayed on a chart:

 

 

 

 

A Ancillary/OTC % of Rev = if(selectedvalue(slicertable[slicer value]) = 2 || isblank(selectedvalue(slicertable[slicer value])) ,[Ancillary/OTC % of Rev])

 

 

 

 

When a single measure is selected, the visual shows that single measure as expected:

BIDev4Life_1-1661435565574.png

However, when selecting 2 or more measures, every measure is shown on the chart. It should only be showing those two measures: 

BIDev4Life_2-1661435607410.png

What am I missing here? Is it the DAX logic? Or the method I have used entirely? 

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @BIDev4Life,

AFAIK, selectedvalue does not suitable to handle multiple selections, if you do not set 'alternate result' option it will return blank when you select multiple items.

For this sceaniro, I'd like to suggest adding a variable table with summarize function to do customized to handle each calculation and aggregate them.

SELECTEDVALUE function - DAX | Microsoft Docs

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.