Forum Discussion
INDEX for table with DAX
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
7 Replies
- parry2kSuper User
Anonymous so what exactly you are after, an Index column? How you are planning to use it? I guess sales price is a measure?
- AnonymousNot applicableYes,Sales price is measure. I want to add index column for power bi visual on above.
- az38Community Champion
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]) ) )
- amitchandakSuper User
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 - Greg_DecklerCommunity Champion
Not exactly sure I get it. But, maybe check out
To *Bleep* with RANKX! - v-zhenbw-msftCommunity Support
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.
- AnonymousNot applicable
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