Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
102 | |
91 | |
87 | |
79 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |