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
RaffiKouzoudj
Helper III
Helper III

Create Index on Visual Table

Hello,

I have a visual table (created from other tables). I am wondering how can I create an index column on this table.

on this table I do not have the option of using M Query (edit query) since this is a visual table. I want to have a DAX query to create this index column. I just want this column to use it later on with the TOP N feature. Thank you.

Table.AddIndexColumn(#"Added Custom1", "Index", 0, 1)

1 ACCEPTED SOLUTION

Hi @RaffiKouzoud,

 

Sorry, Based on the results you expect,RANKX needs a unique column as a condition to sort.

The alternative is to use M query in the original table to add index columns first, and then use DAX to create a new table, which needs to contain the index columns previously added.

Then use the RANKX function to sort the new table according to the index columns in the new table.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3

Capture.PNGDear Amit,

Thank you for your reply, i have reviewed all the 3 links. The issue with my data is that I do not have any integer indicator (value). however, I just want to use DAX on my visual table to list series of number. This series of (unique) number will help me use TOP N filtering. Currently, i used the below code. where I used "Focal Point NAme" which is not unique however this value is repeated less than other indicators. So the RANKX generated numbers however they are not unique value.

 

Main Index = RANKX(ALLSELECTED(Main_Table),CALCULATE(MAX(Main_Table[focal_point_name])),,ASC,Dense)

 

So my question is that how to use DAX Measure to generate incremental row value on the visual table. That is 1,2,3,4,..... N Count. Thank you

 

 

Hi @RaffiKouzoud,

 

Sorry, Based on the results you expect,RANKX needs a unique column as a condition to sort.

The alternative is to use M query in the original table to add index columns first, and then use DAX to create a new table, which needs to contain the index columns previously added.

Then use the RANKX function to sort the new table according to the index columns in the new table.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.