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
Anonymous
Not applicable

Create ascending index column by DAX based on row values

Dear friends

 

please guide me how can i create calculated index column that show ascending number based on value column like attached in data interfaces.

 

NameValueIndex
a102
b101
a51
b152
b203
c102
c51
a153
3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create a new column like

countx(filter(Table, [Name] = earlier([Name]) && [Value] <= earlier([Value])),[Value])

View solution in original post

Tahreem24
Super User
Super User

@Anonymous ,

Try this column:

index =
RANKX (
FILTER (
Sheet4,
EARLIER ( Sheet4[Name] ) = Sheet4[Name]
), Sheet4[Value],,
ASC
)
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

Tahreem24
Super User
Super User

@Anonymous ,

Please see a below Screen shot with output:

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Try this 

Column = 
VAR __name = 'Table'[Name]
VAR __tbl = FILTER( 'Table', 'Table'[Name] = __name )
RETURN 
RANKX( __tbl, 'Table'[Value],, ASC  )

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Tahreem24
Super User
Super User

@Anonymous ,

Please see a below Screen shot with output:

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

@Anonymous ,

Try this column:

index =
RANKX (
FILTER (
Sheet4,
EARLIER ( Sheet4[Name] ) = Sheet4[Name]
), Sheet4[Value],,
ASC
)
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@Anonymous , Create a new column like

countx(filter(Table, [Name] = earlier([Name]) && [Value] <= earlier([Value])),[Value])

Anonymous
Not applicable

Thanks you @amitchandak and @Tahreem24 for quick reply boths are worked correctly!!!

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.