Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello ,
I want to create index wiht DAX for following table. But I could not create a column because working in Direct Query. That why I need a different solution.
The index that will be created with DAX must be ranked with Quanty and sales prices. Sales price and Quantity are directly proportional; when one of them increases other one also increases.
The outout of DAX
Power BI Vısual
Hi @Anonymous ,
We can use the following measure to get an index.
index =
IF (
HASONEVALUE ( 'Table'[CHAN] ),
RANKX ( ALLSELECTED ( 'Table'[CHAN], 'Table'[QUANTY] ), [SALES PRICE] )
)
The result like this,
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-zhenbw-msft ,
Could yo share pbix with me?
It seems like to work but in my desktop does not works, although I checked my code a lot.
Thanks, Br
Not exactly sure I get it. But, maybe check out
@Anonymous , Not very clear you want to do.
For Rank Refer these links
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-3-of-3-the-finale
@Anonymous so what exactly you are after, an Index column? How you are planning to use it? I guess sales price is a measure?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @Anonymous
according the radacad RANKX bible from @amitchandak link, you can try to create a measure like
RANKX(
ALL('Table') ,
CALCULATE(
SUM('Table'[Sales Price])
)
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 93 | |
| 70 | |
| 50 | |
| 40 | |
| 39 |