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 everyone,
Can someone help me come up with a formula to give a categorised value for between numbers.
Rating Ranges: 1-5, 6-10, 11-15, 16-20, 21-25
Categories: Insignificant, Minimal, Moderate, Significant, Extreme
Im hoping to come up with something like IF [Rating] between(1,5) then "Insignificant" etc
Solved! Go to Solution.
That formula is to be done in the Designer and not in Power Query.
If you want it done in Power Query (which has a different syntax and is a separate language) try this.
let
VAL = [Inherent Risk Rating]
in
if
VAL <= 5 then "Insignificant" else if
VAL <= 10 then "Minimal" else if
VAL <= 15 then "Moderate" else if
VAL <= 20 then "Significant" else if
VAL <= 25 then "Extreme" else
null
Sample PBIX for your reference - https://drive.google.com/file/d/1vjiQ_7xdMf5LupiLWCzu-GvGy7rm2qzF/view?usp=sharing
Sorry I'm not sure I've given you enought context. This formula is to look at another column, "Inherent Risk Rating" that is currently a numerical value which I want to group into the categories mentioned above. What I'm trying to do is add a custon column in power query that takes the Inherent Risk Rating and it groups it depending on what range it is in.
Can you please mark the correct reply as the solution?
Hi @Anonymous ,
That happens when you're comparing a number against a text (or vice versa( or using < operator against a text. What formula did you input? Have you checked on the PBIX in my other comment?
Sorry I'm not sure I've given you enought context. This formula is to look at another column, "Inherent Risk Rating" that is currently a numerical value which I want to group into the categories mentioned above. What I'm trying to do is add a custon column in power query that takes the Inherent Risk Rating and it groups it depending on what range it is in.
Please see my other reply.
Hi @Anonymous ,
Try this as a calculated column:
Category =
VAR __VAL = 'Table'[Value]
RETURN
SWITCH (
TRUE (),
__VAL <= 5, "Insignificant",
__VAL <= 10, "Minimal",
__VAL <= 15, "Moderate",
__VAL <= 20, "Significant",
__VAL <= 25, "Extreme",
BLANK ()
)
That formula is to be done in the Designer and not in Power Query.
If you want it done in Power Query (which has a different syntax and is a separate language) try this.
let
VAL = [Inherent Risk Rating]
in
if
VAL <= 5 then "Insignificant" else if
VAL <= 10 then "Minimal" else if
VAL <= 15 then "Moderate" else if
VAL <= 20 then "Significant" else if
VAL <= 25 then "Extreme" else
null
Sample PBIX for your reference - https://drive.google.com/file/d/1vjiQ_7xdMf5LupiLWCzu-GvGy7rm2qzF/view?usp=sharing
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 |
---|---|
71 | |
70 | |
43 | |
31 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |