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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
brdrok
Helper I
Helper I

Rounding question

Hi, 

 

I need some help figuring out how the ROUND function works.  I have the following measure with the output shown below:

 

brdrok_0-1737150127893.png

When I wrap the r1 value inside a Round function with a decimal of 1, I am not getting
0.2
0.3
1.8

but instead I am getting the following output:

brdrok_1-1737150227193.png

Any help would be most appreciated.

 

2 ACCEPTED SOLUTIONS

Okay i missed that the round was within the iterator of the sumx function. Can you move the round function out of the expression like so:

test =
ROUND (
    SUMX (
        Table,
        VAR r1 = IF ( Table[Column] = "Tax", Table[Column2], 0 ) RETURN rt1
    ),
    1
)

 

Or do you actually need to round the number before summing them together?

 

More info on Variables in DAX: https://www.sqlbi.com/articles/variables-in-dax/ 

 

If this post helped, please mark my post as a solution

 

Regards,

 

Thomas Hanson

 

Individual Contributor

View solution in original post

danextian
Super User
Super User

As ROUND is within SUMX it is evaluted for each row in HoldingsReportData before all eveluated rows summed up together in the total row. If you want the total to rounded, wrap it around the SUMX expression instead.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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.

View solution in original post

5 REPLIES 5
brdrok
Helper I
Helper I

Sorry for the late reply @hansontm and @danextian .  Long weekend.  I hope it's ok if I mark both as the answer.  Wrapping the ROUND function outside of SUMX, didn't solve it but as both of you pointed out, it could be a iteration thing.  It appears the numbers are wrong anyways when running the same report on the sql server side.  Again, thank you for taking time looking at this question.

danextian
Super User
Super User

As ROUND is within SUMX it is evaluted for each row in HoldingsReportData before all eveluated rows summed up together in the total row. If you want the total to rounded, wrap it around the SUMX expression instead.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"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.
brdrok
Helper I
Helper I

Thank you for your response.  Inside the Ribbon and the Visual, I have set the decimal to 1 and Auto respectiviely but the behavior continues.  Per your suggestion to put the measure inside a Card visual.  The output below shows the output without the rounding:

brdrok_0-1737155265924.png

With the rounding, the output is as follows:

brdrok_1-1737155299569.png

 

 

Okay i missed that the round was within the iterator of the sumx function. Can you move the round function out of the expression like so:

test =
ROUND (
    SUMX (
        Table,
        VAR r1 = IF ( Table[Column] = "Tax", Table[Column2], 0 ) RETURN rt1
    ),
    1
)

 

Or do you actually need to round the number before summing them together?

 

More info on Variables in DAX: https://www.sqlbi.com/articles/variables-in-dax/ 

 

If this post helped, please mark my post as a solution

 

Regards,

 

Thomas Hanson

 

Individual Contributor

hansontm
Resolver I
Resolver I

Hello,

 

I wouldn't expect this behavior from the ROUND function either. Can you please do a couple checks to make sure 8 wasn't entered in:

1. Under Measure tools ribbon > Formatting, make sure either Auto or 1 is shown

 

hansontm_1-1737153825582.png

2. In Format Visual pane > Specific column > Values > Value decimal places shows Auto or 1

hansontm_2-1737153887338.png

 

What happens if you put the measure in a card visual?

 

If this post helped, please mark my post as a solution

 

Regards,

 

Thomas Hanson

 

Individual Contributor

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.