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
Tevon713
Helper IV
Helper IV

Conditional formatting within the measure

Hi all...

 

Got a simple ask if the difference between 2 data point is < then background color is red else green. I wish to do this all within the measure. Please see below sample.

 

VAR _diffFTECount = _FTECountCurrentYear - FTECountPreviousYear

VAR _result =
SWITCH (
SELECTEDVALUE ( 'Static'[Metrics] ),
"FTE Count", _diffFTECount < 0,"#ffc7ce","#c6efce",
)
RETURN
_result

2 REPLIES 2
vanessafvg
Super User
Super User

not really clear on what you asking, where are you trying to use this measure, what visual.

 

in the formatting area of your visual you should be able to select the measure you have created and select it under field value.  

 

vanessafvg_1-1678228201397.png

 

vanessafvg_0-1678228087757.png

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




I understand what you shared but because the measure was build in specific ordering of metrics I couldn't find a work around it.

Here my earlier post where this was derived from.. 

https://community.powerbi.com/t5/Desktop/Display-table-in-matrix/m-p/3103239#M1051919

 

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.