cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## Create a Measure based on a dynamic slicer selection

Hello Guys!

let me put some backgoud first , im  putting a color rule on a bar chart base on  the following condition

Column ColorOAE = IF( AVERAGE('OAE'[C01_2M])>= [MTARGETOAE] , "#0F0", "#F00")
Column ColorOAE is the measure that i use  as function to put the color in the chart , green if is above  MTARGETOAE and red if is below.
everything works fine if i were only showing the values of  'OAE'[C01_2M] , but in my chart i have a dynamic Y axis , depending on a slicer that could select
all this options
 C01_2M C02_CLAMSHELL C03_4M3 C05_4M1 C06_CELDA_6 C07_CELDA_7 C08_CELDA_8 C09_CELDA_9 C10_CELDA_10 C12_FUJI C13_CANNING_1

how can i change this measure  to achive what i want??

1 ACCEPTED SOLUTION
Community Support

Hi  @joseama1 ,

I created some data:

Here are the steps you can follow：

1. Create measure.

``````Avg =
AVERAGEX(
'Table','Table'[Value])``````
``````Color =
IF(
[Avg]>=[MTARGETOAE],"#0F0", "#F00")``````

2. Column – Color –fx

Format style – Field value

What field should we base this on – [Color]

3. Result:

If the above results do not meet your expectations, can you express the expected results in the form of a picture, we can help you better

Best Regards,

Liu Yang

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

Community Support

Hi  @joseama1 ,

I created some data:

Here are the steps you can follow：

1. Create measure.

``````Avg =
AVERAGEX(
'Table','Table'[Value])``````
``````Color =
IF(
[Avg]>=[MTARGETOAE],"#0F0", "#F00")``````

2. Column – Color –fx

Format style – Field value

What field should we base this on – [Color]

3. Result:

If the above results do not meet your expectations, can you express the expected results in the form of a picture, we can help you better

Best Regards,

Liu Yang

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors