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 y'all,
I am trying to create a custom column that will take the range of numbers from my column A and spit out a specific output. For example, everytime column A lists number between 1-10 I want the custom column to say "1-10". Or everytime column A lists a number between 10-25, I want the custom column to say "10-25", etc etc.
Here is the code I used when attempting to create the custom column:
if number([A])>0 and number([A])<11 then "1-10"
else if number([A])>10 and number([A])<26 then "10-25"
else if number[A]>25 and number[A]<51 then "25-50"
else if number[A]>50 and number[A]<76 then "51-75"
else if number[A]>75 and number[A]<100 then "76-99"
else if number[A]=100 then "100"
else if number[A]=0 then "0"
else "unknown"
I have received this error message:
Expression.Error: The name 'number' wasn't recognized. Make sure it's spelled correctly.
Any help would be much appreicated or any advice for doing this another way!
Thanks!
Solved! Go to Solution.
If you merely remove the "number" and the parentheses everywhere, it will work!
--Nate
You didn't ask, but your else if clauses could be more efficient; no need for "and":
if [A] = 100 then "100" else if [A] > 75 then "76-99" else if [A] > 50 then "51-75" else if [A] > 25 then "26-50" else if [A] > 10 then "10-25" else if [A] > 0 then "1-10" else if [A] = 0 then "0" else "Unknown"
--Nate
You didn't ask, but your else if clauses could be more efficient; no need for "and":
if [A] = 100 then "100" else if [A] > 75 then "76-99" else if [A] > 50 then "51-75" else if [A] > 25 then "26-50" else if [A] > 10 then "10-25" else if [A] > 0 then "1-10" else if [A] = 0 then "0" else "Unknown"
--Nate
If you merely remove the "number" and the parentheses everywhere, it will work!
--Nate
Hey @CobbSalad ,
It seems to be working fine for me using :
=if [Number] > 0 and [Number] < 11 then "1-10" else if [Number] > 10 and [Number] < 26 then "11-25" else if [Number] > 25 and [Number] < 40 then "26-40" else "NO"
What are you listing the word number for in your code was it to say something along the lines of if this value is a number which is greater than 0...?
Proud to be a Super User!
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 |
---|---|
14 | |
13 | |
13 | |
13 | |
9 |