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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
poli361
Helper I
Helper I

Dynamic Conditional Formatting based on SELECTEDMEASURE()

Hi I am trying to get a Font rule that works for every Calculation without using conditional format style "Rules" and applying them to every calculation . 

poli361_0-1700145284047.png

 

I am using a code like that so I can choose "Field Value" and then this dax measurement

Diff Font = var calc=SELECTEDMEASURE()

var result=if(calc > 0,"Green",if(calc<0,"Red","White"))
RETURN calc

I cant get it right though . Do you know if there is a problem when using SELECTEDMEASURE() in Conditional Formatting .
Thank you a lot in advance
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @poli361 ,

 

I seem to understand your needs. You want to set the font in the matrix, but the measures in your matrix are replaced or you have multiple measures, but you don't want to re-modify the conditional formatting because of the replacement, or repeatedly set the conditional formatting.

I'm sorry, it is currently unavailable. You need to erpeat steps each measure you want to apply conditional formatting to.

Maybe you could submit an idea for this:

Ideas (microsoft.com)

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @poli361 ,

 

I seem to understand your needs. You want to set the font in the matrix, but the measures in your matrix are replaced or you have multiple measures, but you don't want to re-modify the conditional formatting because of the replacement, or repeatedly set the conditional formatting.

I'm sorry, it is currently unavailable. You need to erpeat steps each measure you want to apply conditional formatting to.

Maybe you could submit an idea for this:

Ideas (microsoft.com)

 

 

Best Regards,

Stephen Tao

 

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

Bmejia
Super User
Super User

Conditional formating done at column level.  The only way this would work is if your data all came from a pivot table

 

example:

Bmejia_0-1700236154168.png


Measure:

Color =
Var Color_ = if(SELECTEDVALUE(ColorT[Value])>5,"Green")
return Color_
Bmejia_1-1700236224799.png

 

 



Thank you for replying . I just want to make one measurement to work on any measurement I put . 
In your example you are using one column "ColorT[Value]" , but I want to use a dynamic column , which will be whatever I put inside the matrix table . 

Bmejia
Super User
Super User

I believe you still have to go into conditional formating and choose "Field Value" for the Format Style and your measure with the color data in the "What Field should be base this on"

Bmejia_0-1700168376255.png

 

Thats not the solution I am trying to get . I need to create a measurement to work on any measurement I put on my visual , that's why I am calling SELECTEDMEASURE() . It seems that it doesn't work .

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.