Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys,
Can anyone help me how to make new column using measure to lookup the Grade below.
Type A, the bigger the Green is, and Type B is opposite.
So how can I run IF or Switch function?
The function I tried seems wrong,,
Thanks in advance.
Kim
Solved! Go to Solution.
Hi @jeongkim ,
You can create a calculated column as below in the table 'SKT' to get it:
Icon Grade =
SWITCH (
TRUE (),
'SKT'[Type] = 1
&& 'SKT'[Value] < 'SKT'[Red], 1,
'SKT'[Type] = 1
&& 'SKT'[Value] > 'SKT'[Red]
&& 'SKT'[Value] <= 'SKT'[Light-Red], 2,
'SKT'[Type] = 1
&& 'SKT'[Value] >= 'SKT'[Light-Green], 4,
'SKT'[Type] = 1
&& 'SKT'[Value] >= 'SKT'[Green], 5,
'SKT'[Type] = -1
&& 'SKT'[Value] >= 'SKT'[Red], 1,
'SKT'[Type] = -1
&& 'SKT'[Value] < 'SKT'[Red]
&& 'SKT'[Value] >= 'SKT'[Light-Red], 2,
'SKT'[Type] = -1
&& 'SKT'[Value] <= 'SKT'[Light-Green], 4,
'SKT'[Type] = -1
&& 'SKT'[Value] <= 'SKT'[Green], 5,
3
)
Best Regards
Hi @jeongkim ,
You can create a calculated column as below in the table 'SKT' to get it:
Icon Grade =
SWITCH (
TRUE (),
'SKT'[Type] = 1
&& 'SKT'[Value] < 'SKT'[Red], 1,
'SKT'[Type] = 1
&& 'SKT'[Value] > 'SKT'[Red]
&& 'SKT'[Value] <= 'SKT'[Light-Red], 2,
'SKT'[Type] = 1
&& 'SKT'[Value] >= 'SKT'[Light-Green], 4,
'SKT'[Type] = 1
&& 'SKT'[Value] >= 'SKT'[Green], 5,
'SKT'[Type] = -1
&& 'SKT'[Value] >= 'SKT'[Red], 1,
'SKT'[Type] = -1
&& 'SKT'[Value] < 'SKT'[Red]
&& 'SKT'[Value] >= 'SKT'[Light-Red], 2,
'SKT'[Type] = -1
&& 'SKT'[Value] <= 'SKT'[Light-Green], 4,
'SKT'[Type] = -1
&& 'SKT'[Value] <= 'SKT'[Green], 5,
3
)
Best Regards
also how can I add another condition? if the Value is (blank) then just leave it blank without grading?
Hi @jeongkim ,
You can update the formula of calculated column as below to get it:
Icon Grade = SWITCH ( TRUE (), ISBLANK ( 'SKT'[Value] ), BLANK (), 'SKT'[Type] = 1 && 'SKT'[Value] < 'SKT'[Red], 1, 'SKT'[Type] = 1 && 'SKT'[Value] > 'SKT'[Red] && 'SKT'[Value] <= 'SKT'[Light-Red], 2, 'SKT'[Type] = 1 && 'SKT'[Value] >= 'SKT'[Light-Green], 4, 'SKT'[Type] = 1 && 'SKT'[Value] >= 'SKT'[Green], 5, 'SKT'[Type] = -1 && 'SKT'[Value] >= 'SKT'[Red], 1, 'SKT'[Type] = -1 && 'SKT'[Value] < 'SKT'[Red] && 'SKT'[Value] >= 'SKT'[Light-Red], 2, 'SKT'[Type] = -1 && 'SKT'[Value] <= 'SKT'[Light-Green], 4, 'SKT'[Type] = -1 && 'SKT'[Value] <= 'SKT'[Green], 5, 3 ) |
Best Regards
Thank you so much! It is simpler and now working 🙂
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
63 | |
53 | |
39 | |
25 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |