Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Why do the same values have different rank number?

Hi all,

 

I find a strange thing in my report. I have ID, expenses, and rank.

The ID column is just a column value,

The Expenses column is a sum of amount, not a measure.

RANK = RANKX(ALL(DiDi[employee_id]),[Measure 2],,DESC,Skip)
Measure 2 = SUM([amount_final])

 

Why do the same values have different rank number.PNG


As you can see, these IDs have the same expenses - 2500, but the rank is different.

I have checked the details. The sum of the amount is just 2500, with no decimals.

 

And I want to check the reason, so I reduce the table, now the table only has month, order_id, id, type, amount columns.

I'm still trying to figure out the reason but don't know how to do.

 

If you have any suggestions or know the reason, please tell me.

If you need more information, please tell me.

 

Thanks in advance.

Aiolos Zhao

9 REPLIES 9
Anonymous
Not applicable

I study with the decimal number and fixed decimal number.

 

Then I change my amount column to fixed-decimal-number type, it solved.

 

But I still want to know why the number is different between the MYSQL database and power bi desktop.

 

Aiolos Zhao
 

I've re-read your comment and realized that you mentioned double(10,2) which should return just two decimal places.  I've found a similar issue on https://community.powerbi.com/t5/Desktop/Power-Query-decimal-precision-problem-does-not-get-to-0-whe...










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian,

 

Sorry for reply late and thanks for your reply.

 

Yes, I'm using the double(10,2) in my MYSQL database for this column, so I think it won't be the MYSQL problem.

 

And I saw the link you mentions, do you think it is a bug of Power BI about precision decimal?

 

For now, I can use "Change Type to decimal number" to solve this problem.

 

Thanks.

Aiolos Zhao

Hi @Anonymous 

It could be that what you see on MYSQL is truncated and Power BI just loads the exact number. 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
V-pazhen-msft
Community Support
Community Support

Hi,  @Anonymous 

I think I would need more information for the solution. If you can provide a data table and drag your “Measure 2” into the visual table, It should be more clear. 

 

According to the current description, it might be because you ranked with a measure but include a column in the table. Importantly, A measure only considers the current row, and a column considers each row. They return different values even with the same formula. I have an example for you to clarify:

 

SumMeasure = SUM([Value])
SumColumn = SUM([Value])
Rank = RANKX(ALL(Sheet1[Index]),[SumMeasure],,DESC,Skip)

 

 same value different rank.JPG

 

Best, 
Paul


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @V-pazhen-msft ,

 

Thanks for your reply. I checked my measure. I think it's correct.

I found my problem, and you can see my reply above.

The value is 52.99 in my MYSQL table, but it shows 52.99.....02 in my power bi desktop.

 

It's strange, and I'm trying to load the id only to see whether it still has the issue.

Aiolos Zhao

Anonymous
Not applicable

I have grouped by id, month, and type to sum amount. (Reduce order id)

 

Now the table only has around 30,000 rows, but the result is also wrong.

 

Aiolos Zhao

Hi  , 

Have you tried creating  a checker formula to determine if indeed your measure returns a flat 2500 for each ID? You can tryChecker = [Measure] = 2500which will return true/false. It could be that your 2500 is actually 2500.00000000012121. 

 

Is your ID being sorted by another column? If it is, the sort by column should be included in your RANKX argument. 

Rank =
RANKX ( ALL ( 'Table'[ID], 'Table'[SortBy] ), [Sum of Values],, DESC, SKIP )

 

 

 

@Anonymous










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian,

 

Thanks for your reply. I use the checker like you said, it works.

Why do the same values have different rank number 2.PNG

 

But now I wonder why the number is ......02, in the database, I'm using MySQL, the type of amount column is double(10,2), the value is 52.99.

 

But after I loaded into power bi, it change to 52.99........02.

 

Aiolos Zhao

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.