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.
I have 2 columns id and note_id, how can I access the last 3 note_id's for each id using Dax?
Solved! Go to Solution.
Hi @aanchalshah18 ,
You can create a ranking column with values by id and filter.
Check this link: https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/
Ricardo
If you have data like this and want the result below:
Please Create measures
Measure = RANKX(ALLEXCEPT('Table','Table'[id]),CALCULATE(SUM('Table'[Index])),,DESC,Dense)
If you have data like this and want the result below:
Please Create measures
Measure = RANKX(ALLEXCEPT('Table','Table'[id]),CALCULATE(SUM('Table'[Index])),,DESC,Dense)
Hi,
Thanks for this, this is what I exactly need but can you tell me how you got the index column?
Hi,
You can choose the TOP option and I think that will do.
Best regards,
Alin Oprita
If you need only three ID
rankx(all(table),table[note_id],,desc,dense)
If you need three with in Id, refer
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin
Hi @aanchalshah18 ,
You can create a ranking column with values by id and filter.
Check this link: https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/
Ricardo
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |