The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
121 | |
86 | |
77 | |
55 | |
48 |
User | Count |
---|---|
136 | |
128 | |
78 | |
64 | |
63 |