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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors