Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
majdkaid22
Helper V
Helper V

numbers in range

Hi,

 

Am trying to create a column using IF to assign an entity name for for account numbers within particular range.

 

For example:

 

Account number with range 70000 to 79999 and 1050000 to 1059999 call them Entity one 

Account number with range 80000 to 89999 call them entity two 

 

Am I wrong using the IF? I think am not putting the logic of =< and => correctly in the formula 

 

 

Appreciate any help

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @majdkaid22,

 

>>You can use below formula to format the account number.

Your logic seems right, but your spell was wrong.(it should be >, <, =, <>, >= , <=  ) You can refer to below formula to format the account number.

 

Calculate column:

 

Entity = if(OR('Table'[AccountNumber]>=70000&&'Table'[AccountNumber]<=79999,'Table'[AccountNumber]>=1050000&&'Table'[AccountNumber]<=1059999),"Entity one",IF('Table'[AccountNumber]>=80000&&'Table'[AccountNumber]<=89999,"Entity one","Other"))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @majdkaid22,

 

>>You can use below formula to format the account number.

Your logic seems right, but your spell was wrong.(it should be >, <, =, <>, >= , <=  ) You can refer to below formula to format the account number.

 

Calculate column:

 

Entity = if(OR('Table'[AccountNumber]>=70000&&'Table'[AccountNumber]<=79999,'Table'[AccountNumber]>=1050000&&'Table'[AccountNumber]<=1059999),"Entity one",IF('Table'[AccountNumber]>=80000&&'Table'[AccountNumber]<=89999,"Entity one","Other"))

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

much appreicated @v-shex-msft worked as a treat 🙂 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.