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.
I am trying to assign different colors for different states dependent if they have the functions or not (DE, DR, PCC are the functions).
Example - 1 color would be states AL, GA, HI, MS, NE (they have zero across the board)
Example 2 color would be DE, ME, MN (they only have zeros PCC)
Example 3 color would be KY (has zero in DE and PCC)
Example 4 color would be all the rest of the states (they have values in each of the functions)
Solved! Go to Solution.
Hi @jcastr02 ,
Based on your description, it appears that you want to classify states into groups based on specific conditions and then apply unique color codes to those groups. Here is a step-by-step approach to accomplish this in Power BI:
StateCategory =
VAR DE_Value =
MAX ( 'Table'[DE_Column] )
VAR DR_Value =
MAX ( 'Table'[DR_Column] )
VAR PCC_Value =
MAX ( 'Table'[PCC_Column] )
RETURN
SWITCH (
TRUE (),
DE_Value = 0
&& DR_Value = 0
&& PCC_Value = 0, "Color1",
DE_Value = 0
&& DR_Value = 0
&& PCC_Value > 0, "Color2",
DE_Value = 0
&& DR_Value > 0
&& PCC_Value = 0, "Color2",
DE_Value = 0
&& DR_Value > 0
&& PCC_Value > 0, "Color3",
DE_Value > 0
&& DR_Value = 0
&& PCC_Value = 0, "Color3",
DE_Value > 0
&& DR_Value = 0
&& PCC_Value > 0, "Color4",
DE_Value > 0
&& DR_Value > 0
&& PCC_Value = 0, "Color4",
DE_Value > 0
&& DR_Value > 0
&& PCC_Value > 0, "Color5",
"other"
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jcastr02 ,
Based on your description, it appears that you want to classify states into groups based on specific conditions and then apply unique color codes to those groups. Here is a step-by-step approach to accomplish this in Power BI:
StateCategory =
VAR DE_Value =
MAX ( 'Table'[DE_Column] )
VAR DR_Value =
MAX ( 'Table'[DR_Column] )
VAR PCC_Value =
MAX ( 'Table'[PCC_Column] )
RETURN
SWITCH (
TRUE (),
DE_Value = 0
&& DR_Value = 0
&& PCC_Value = 0, "Color1",
DE_Value = 0
&& DR_Value = 0
&& PCC_Value > 0, "Color2",
DE_Value = 0
&& DR_Value > 0
&& PCC_Value = 0, "Color2",
DE_Value = 0
&& DR_Value > 0
&& PCC_Value > 0, "Color3",
DE_Value > 0
&& DR_Value = 0
&& PCC_Value = 0, "Color3",
DE_Value > 0
&& DR_Value = 0
&& PCC_Value > 0, "Color4",
DE_Value > 0
&& DR_Value > 0
&& PCC_Value = 0, "Color4",
DE_Value > 0
&& DR_Value > 0
&& PCC_Value > 0, "Color5",
"other"
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |