Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
User | Count |
---|---|
116 | |
73 | |
58 | |
49 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |