Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Oi pessoal!
Eu preciso de uma ajudinha com um problema de índice. Quero criar um índice condicional baseado na coluna "qtd venda" (see the anex).
Basicamente, o primeiro número do índice precisa seguir o número máximo de "qtd venda".
Obrigado,
Hi, @Anonymous ;
You could add index column in power query.
Sort first.
add index column next.
Or in desktop create a column by dax.
Index2 = RANKX('Table',[qtd],,DESC)-1
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yalanwu-msft,
First, thanks for helping.
Sorry for not being clear.
I tried solve this using the sort function, but if the "qtd venda" (sales amount) number change position, the index will follow.
Lets use this table:
If the sales amount of any cod change, the index will move, even if i sort the column and the table will do that:
But i need this:
Index 1 must always be linked to the highest sales amount. I tried with RANKX but when sales amount of two lines has the same value, the rank number is the same for both, even using dense function.
I hope it was more clearer.
Thanks,
Hi, @Anonymous ;
So you need to sort value first, and then add the index column.
I don't quite understand what you mean, if you can, can you share a simple file and want the output to show the results?
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-yalanwu-msft,
I did it using this way of sorting, the problem is the problem is that this dataset will be fed in the future, I started to realize that performing this task in powerquery using index will not work.
I need to sort the ''cod prod'' by indexes based on sales amount and if that value changes, the highest value will always be index 1. Basically, it's a rank in DAX, where the highest value will always be rank 1 and so on. But I have several products that have the same sales numbers and rankx doubles the position of these products even using rankx dense.
Hi, @Anonymous ;
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Oi @Anonymous,
você poderia fornecer uma captura de tela da visualização desejada? Isso não é óbvio do que você tem o que você está tentando alcançar.
Obrigado,
John
Sorry for that.
I need the Index follow the MAX of sales amount.
Lets use this table:
If the sales amount of any cod change, the index will move, even if i sort the column and the table will do that:
But i need this:
Index 1 must always be linked to the highest sales amount. I tried with RANKX but when sales amount of two lines has the same value, the rank number is the same for both, even using dense function.
I hope it was more clearer
Thanks,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |