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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Maia_LR
Regular Visitor

SELECTEDMEASURENAME() and SELECTEDMEASURE() in field type Conditional Formatting

Dear all,

I'm trying to build a measure called [_Colours] that allows to apply a different combination of colours depending on the selected measure I have by using a field type CONDITIONAL FORMATTING and SELECTEMEASURENAME() and SELECTEDMEASURE() functions but it seems that those doesn't works into a conditional formatting: the goal is to avoid to create an specific conditional formatting for each measure.

Maia_LR_0-1715864305328.png

Maia_LR_1-1715864340888.jpeg

Any suggestion?

Thank you in advanced

2 REPLIES 2
Maia_LR
Regular Visitor

Hi @v-yilong-msft ,

Thanks for your kind reply but this is not exactly what I am asking for: I really know how to link a measure to a conditional formatting but my question was about how to create a dynamic conditional formatting for distinct fields (i.e. % yoy expenses and % yoy incomes) by using a single measure, not several measures, one for each field.

My thinking was using SELECTEDMEASURE() function but as you told me I checked that this functions only works in calculation groups but not in any standard measure.

Thank you anyway.

Best regards

v-yilong-msft
Community Support
Community Support

Hi @Maia_LR ,

SELECTEDMEASURENAME() and SELECTEDMEASURE() really do not work in conditional formatting.

I created similar tables and conditional formatting.

vyilongmsft_0-1715917356989.png

If you want to differentiate by color I think you can just use the following DAX code.

Colors = 
IF('Table'[Measure]>50,"Green","Red")

vyilongmsft_1-1715917932792.png

vyilongmsft_2-1715917963073.png

 

 

 

Best Regards

Yilong Zhou

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors