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
chinex
New Member

Measure logic that deals with multiple selection on slicer

Hi all, this is the issue I have. The measure shows a ratio value based on both selecting a ratio and a range. In the below screenshot i have selected "90%-100%" range, so it works perfectly as long as the user only makes one selection. But if multiple selections are done, i'm not sure how to deal with that in the red section below:

 

Y Axis Ratio Value =
IF(HASONEVALUE('Y Ratio Ranges'[Y Ratio Ranges]),
CALCULATE(
AVERAGE('MAIN -Long Bar Consol SS ShkO Trend'[Value]),
FILTER('MAIN -Long Bar Consol SS ShkO Trend','MAIN -Long Bar Consol SS ShkO Trend'[Ratio] = [Y Axis Selected Ratio]),
FILTER('MAIN -Long Bar Consol SS ShkO Trend','MAIN -Long Bar Consol SS ShkO Trend'[Ratio Ranges] = [Y Axis Selected Ratio Range])
),
CALCULATE(
AVERAGE('MAIN -Long Bar Consol SS ShkO Trend'[Value]),
FILTER('MAIN -Long Bar Consol SS ShkO Trend','MAIN -Long Bar Consol SS ShkO Trend'[Ratio] = [Y Axis Selected Ratio])
)
)

chinex_0-1632867676590.png

thanks!

1 REPLY 1
VahidDM
Super User
Super User

Hi @chinex 

 

Are those [Y Axis Selected Ratio] and [Y Axis Selected Ratio Range] from MAIN -Long Bar Consol SS ShkO Trend table?

If yes, just use this measure:

Y Axis Ratio Value =
AVERAGE('MAIN -Long Bar Consol SS ShkO Trend'[Value])

 

When you select items on the slicer, it will filter your table and you don't need to add filter to your measure.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

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.