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.
Hi All,
I have a the below RANKX function:
Rank of Country by Selection =
RANKX(
ALL(Data[Country]),
CALCULATE(
SUM(Data[Price])
),,DESC,Dense
)
The data is from a MS SQL database retrieved as Import query.
The RANKX() works when I display the Country and Price in a table. But as soon as I add Quantity column the rank does not work for 1 and 2. See image below.
When I export the data of the table from Power BI visual and do the same RANKX() function, then ranking works propoerly even with Quantity.
I am guessing this must be something to do with the data from database but cannot think of what.
Any help will be appreciated.
Hi @anandav,
I was not abble to reproduce using my version of PBI and a mockup of your data so everything should work based on your dax measure, can you give a bigger sample of your data wih the full table layout and contents or a mockup of the PBIX.
The measure in DAX should I even added some additional columns like dates and categories and all went well except when adding formulas that had additional details like dates, but using values in the table the result was as expected.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
Thanks for your reply.
When I tried the dataset as a csv file (about 50K rows) and used the same measure everything works well.
The issue occurs only when I connect to database and Import data. So providing the dataset in csv or Excel will not reproduce the issue.
I understand it is difficult to answer without being able to reporduce the issue, but unfortunately since it is company production data it is not possible to access from outside. But same data in csv or Excel file when used with the same measure works properly.
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |