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! Learn more

Reply
Anonymous
Not applicable

SUM in PowerBI not rounding correctly

Hi, 

 

I have a column that is summing the lines of an order together, and then i am rounding this decimal to two decimal places. Seems fine. 

 

Power BI however, when using the inbuilt SUM feature produces this: 

 

annaselway_0-1603798932851.png

 

Where the value it is rounding up is 41.895 - therefore in rounding this should be 41.90.  (the bottom row)

 

I therefore tried to create a measure that calculates the sum of an order based on the order number, and rounds it to two decimal places - however this also rounds 41.895 to 41.89 

 

 

TotalGrossPerOrder = ROUND(SUMX(VALUES('fact Orders'[PurchaseOrderNumber]), CALCULATE(SUM('fact Orders'[LineGross]))), 2)

 

 

annaselway_1-1603799018540.png (second from bottom row)

 

The only way i seem to be able to get it to round correctly, is on this measure force the decimals to three places: 

Screenshot 4.PNG

 

But obviously this then gives me the figure with a 0 on the end: 41.890. 

 
 
 

Any ideas what i'm doing wrong? 

 

 

 

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I assume that you want to round up the measure. You may try the roundup .

Measure = ROUNDUP(SUM('Table'[Val]),2)

 

Result:

d1.png

 

Best Regards

Allan

 

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

tex628
Community Champion
Community Champion

Can you provide a picture of the amount of all the rows contained in that order, in the data view (See below)? Please also modify the decimals in the column so that you show atleast 5 decimals. 

image.png

Br,

J


Connect on LinkedIn
Anonymous
Not applicable

Hi, So i'm using direct query - and for that order there is only a single transaction - so it isn't actually having to sum anything. 

 

Five decimal places: 

annaselway_0-1603805262836.png

 

41.89490 is not rounding correctly - it should be 41.90 not 41.89

The rounded value of 41.89490 is 41.89 using standard rounding calculation.  .00490 is less than 0.005, so it rounds down to zero at two decimal places. 0.0050 and greater rounds up to 0.01

tex628
Community Champion
Community Champion

After consulting a colleague I was told the rounding should be correct :). When rounding you consider all decimals -> 

10,645
0,0005 Rounds up to
10,65

10,645
0,0045 Rounds down to
10,6

So in the second example you round from 0,0045, not 0,005. 

If you want any other type of logic you will need to convert the actual column before the automated rounding happens. You can do this by identifying where the decimals create this situation, XXX.XX4(5-9) (3rd decimal is a "4" & 4th is 5 or higher). Then change the actual values to allow the rounding to work as you desire. 

Br,
J


Connect on LinkedIn
tex628
Community Champion
Community Champion

I believe this has to do with direct query. I've been able to recreate your problem and I'm running a few tests. I'll get back to you. 

/ J


Connect on LinkedIn

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