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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
electrichead
Frequent Visitor

Matching matrix values no longer match when truncated to 2 decimal places. Weird .005 rounding.

I have a matrix visual with a DAX calculation that provides the values for the matrix.  I wanted to check the formula, so I created a second value column and added a new DAX measure that should give me the same result but using a different calculation.

 

Both formulas give me 4.565

 

When I adjust the matrix visual to only show 2 decimal places one value rounds up to 4.57 and the other round down to 4.56.

I'm not using any round functions in the formulas.  Any idea why I'm seeing this?  I would assume adjusting the decimal value shown within the matrix visual only affects the shown formula result, but does it also affect the values within the calculation?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @electrichead 

Based on your information, I create a sample table:

vyohuamsft_0-1722927557948.png

I tried to simulate three different scenarios, I created some visuals to contrast.

The first matrix is the raw data, showing all the decimals. The second matrix uses the Sum function to simulate what you get after using the measure, and I manually kept three decimal places. But in fact, there are still a lot of decimal numbers behind it.

OriginalMeasure = SUM('Table'[SalesAmount])

vyohuamsft_2-1722928284747.png

Next, create a new measure, using the Round function to keep only two decimal places

RoundedOriginalMeasure = ROUND([OriginalMeasure], 2)

vyohuamsft_3-1722928503029.png

Did you find out? It is not rounded to the decimal set on the surface, it is calculated according to the original data (including all decimals). And its logic is to round the next decimal place where you need to keep a few decimal places. As shown in the diagram, 4.564523, with two decimal places, it will be treated as 4.564 first, and then trade-off, so that 4.56 is obtained.

Therefore, we need to modify the original data with measures or calculated columns to preserve the number of decimal places, force it to be rounded, and retain three decimal places. So that it actually has only three decimal places, with no extra decimals

Round = ROUND(SUM('Table'[SalesAmount]),3)

vyohuamsft_4-1722929234327.png

 

Instead of formatting it with a few decimal places

vyohuamsft_6-1722929346923.png

 

Finally, create a metric to keep two decimal places, so that it will all become 4.57

Round 2 = ROUND('Table'[Round],2)

vyohuamsft_7-1722929576686.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi, @electrichead 

Based on your information, I create a sample table:

vyohuamsft_0-1722927557948.png

I tried to simulate three different scenarios, I created some visuals to contrast.

The first matrix is the raw data, showing all the decimals. The second matrix uses the Sum function to simulate what you get after using the measure, and I manually kept three decimal places. But in fact, there are still a lot of decimal numbers behind it.

OriginalMeasure = SUM('Table'[SalesAmount])

vyohuamsft_2-1722928284747.png

Next, create a new measure, using the Round function to keep only two decimal places

RoundedOriginalMeasure = ROUND([OriginalMeasure], 2)

vyohuamsft_3-1722928503029.png

Did you find out? It is not rounded to the decimal set on the surface, it is calculated according to the original data (including all decimals). And its logic is to round the next decimal place where you need to keep a few decimal places. As shown in the diagram, 4.564523, with two decimal places, it will be treated as 4.564 first, and then trade-off, so that 4.56 is obtained.

Therefore, we need to modify the original data with measures or calculated columns to preserve the number of decimal places, force it to be rounded, and retain three decimal places. So that it actually has only three decimal places, with no extra decimals

Round = ROUND(SUM('Table'[SalesAmount]),3)

vyohuamsft_4-1722929234327.png

 

Instead of formatting it with a few decimal places

vyohuamsft_6-1722929346923.png

 

Finally, create a metric to keep two decimal places, so that it will all become 4.57

Round 2 = ROUND('Table'[Round],2)

vyohuamsft_7-1722929576686.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Thanks for breaking that down.  I do think I understand what your illustrating, and I appreciate the detail.  I'm not sure if that is quite what I was seeing though.  In your example, 13.6945 was never rounded or displayed as though rounded down to 13.694.


For now I'm going to chaulk this up to an oddity that was transient.  I shared my screen with a colleague and he witnessed it too, but over the last two days after shutting things down and restarting I have not been able to recreate it.  If I can I'll return with more details and screenshots.

Anonymous
Not applicable

Hi, @electrichead 

This is because my OriginalMeasure = SUM('Table'[SalesAmount]) and I just formatted it to 3 as a decimal, which is actually still 13.694569. Then, as I said above, when going to a few decimal places, it will be judged by the last digit of a few decimal places. If you were to leave 3 decimal places, then his rounding would be 13.695 based on the 5 after 4. Its strange logic doesn't follow our daily rounding up of the last digit and adding one step by step. Assuming its value is 13.694469, then keeping three decimal places and rounding it to the credential is 4 after 4, and 69 after it is completely ignored. I hope you understand. And I wish you all the best.

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

SamWiseOwl
Super User
Super User

Hi @electrichead 

Would you be ok sharing the DAX?


Cheers

Sam


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors