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
Alice-Jen
Frequent Visitor

Is it possible to do conditional formatting based on field parameter?

We can use a field parameter to control visual properties. I created a gauge visual and want to fill color  base on field parameter.

AliceJen_2-1668778219022.png


For every selected parameter has different value range for color. For example , if selected parameter is phosphorus. The color range should like below.

AliceJen_0-1668777553683.png

If selected parameter is nitrigen.The color range should like below.

AliceJen_1-1668777692098.png

Is there anyone can help me to solve this question? 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Alice-Jen , You will not gradient for that

 

exmaple color measure

 

Measure =
Switch(true(),
max(Table[status]) = "In production" , Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
) ,
max(Table[status]) = " Product completed" , Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)
)

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi,

Thank you so much your solution. What does [SLA]  mean?
I have field parameters 

Parameters = {
    ("Phosphorus", NAMEOF('Sheet1'[Average of Total fosfor ug/l]), 0),
    ("Nitrigen", NAMEOF('Sheet1'[Average of Total kväve ug/l]), 1),
    ("Oxygen_saturation", NAMEOF('Sheet1'[Average of Syremättnad %]), 2)
}
Should I add a measure under the table Parameters like below:
Measure =
Switch(true(),
max(Parameters[Parameters]) = "Phosphorus" , Switch(true(),
[SLA] >= 25 && [SLA] <= 50 , "Green" ,
[SLA] > 50 && [SLA] <= 100, "Amber" ,
"Red "
) ,
max(Parameters[Parameters]) = "Nitrigen" , Switch(true(),
[SLA] >= 300 && [SLA] <= 625 , "Green" ,
[SLA] > 625 && [SLA] <= 1200, "Amber" ,
"Red "
)
)
 
AliceJen_0-1669035441178.png

Thans in advance.

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.