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.
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)
Solved! Go to 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.
It can be done using Rank.
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
Dear 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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |