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
Tevon713
Helper IV
Helper IV

Adding index column base value of a column

Hi. 

 

I have a simple inquiry, want to add new column or measure index based on the column "Days in Query". 

If DaysinQuery is >5 then index = 3, 6-10 then index = 2 and >10 then index =1.  Thank you all.

 

Example:

Acct DaysinQuery
1 >5
2 6-10
3 >10
4 >10
5 6-10
6 6-10
7 >5
8 6-10
9 >5
10 >10

 

Desire result:

Acct DaysinQuery OrderingIndex
1 >5 3
2 6-10 2
3 >10 1
4 >10 1
5 6-10 2
6 6-10 2
7 >5 3
8 6-10 2
9 >5 3
10 >10 1
1 ACCEPTED SOLUTION
RemyO
Resolver I
Resolver I

First of all i think you want days =<5 but if thats the text then it is so. Just doesnt make sense,

Create a new column:

OrderingIndex = IF('TableName'[DaysInQuery] = ">5",3,

                                IF('TableName'[DaysInQuery] = ">10",1,2))

View solution in original post

1 REPLY 1
RemyO
Resolver I
Resolver I

First of all i think you want days =<5 but if thats the text then it is so. Just doesnt make sense,

Create a new column:

OrderingIndex = IF('TableName'[DaysInQuery] = ">5",3,

                                IF('TableName'[DaysInQuery] = ">10",1,2))

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.