Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hi,
I need to create a rule for example:
if sum(Sales)>value_1, red,
if value_2<sum(Sales)<value_1, green
if sum(Sales)<value_2, yellow
and I need to creare these value_1, value_2 dynamic ( I need to choose them)
how can I do?
Thank you
Giada
Solved! Go to Solution.
@Giada_Togliatti , Value_1, and Value_2 can be whatif measure
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
And you can create a color measure and use option and field and use the measure in conditional formatting
measure= Switch( true(),
sum(Sales)>selectedvalue(value_1[value_1]), "red",
sum(Sales)>selectedvalue(value_[value_2]) && sum(Sales)<selectedvalue(value_1[value_1]), "green",
sum(Sales)>selectedvalue(value_[value_2]), "yellow",
"blue")
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
Hi @Giada_Togliatti ,
You can create a measure using following DAX as follows: (Modify it based on the columns and measures you want to use)
Hi @Giada_Togliatti ,
You can create a measure using following DAX as follows: (Modify it based on the columns and measures you want to use)
@Giada_Togliatti , Value_1, and Value_2 can be whatif measure
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
And you can create a color measure and use option and field and use the measure in conditional formatting
measure= Switch( true(),
sum(Sales)>selectedvalue(value_1[value_1]), "red",
sum(Sales)>selectedvalue(value_[value_2]) && sum(Sales)<selectedvalue(value_1[value_1]), "green",
sum(Sales)>selectedvalue(value_[value_2]), "yellow",
"blue")
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values
it works, thank you!
Read my blog for how to write the DAX. https://exceleratorbi.com.au/conditional-formatting-with-a-text-field-in-power-bi/
for the selection, you need a What If Parameter
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
79 | |
72 | |
71 | |
54 | |
51 |
User | Count |
---|---|
45 | |
38 | |
33 | |
31 | |
28 |