Forum Discussion
Rounding - If statement
- 6 years ago
Hi Anonymous
The round function requires you to give it a number of digits to round to.
for example;
ROUND(Value,0) would give you the value to the nearest integer.
Hope this helps.
George
- 6 years ago
I often get this error when I have misplaced (or missed out) a bracket, and so it things you haven't given a 'then' or 'else' statement.
Make sure you haven't missed a bracket after ROUND(SUM())
Hi,
Thanks for the quick response!
I'm wanting it as a measure I think.
I want to be able to show rounded figures for the majority of my charts, but I also want to be able to use the percentages which means I need to use the raw data to calculate them.
I've had a look at the DAX page but when i've tried to write the statement out in PBI it brings back errors. Below is the measure i've tried to create but the error says 'Too few arguments were passed to the ROUND function...'.
IF(SUM('LA level data (unrounded)'[Jobs])<15,ROUND(SUM('LA level data (unrounded)'[Jobs])/10.0)*10,
IF(SUM('LA level data (unrounded)'[Jobs])<500,ROUND(SUM('LA level data (unrounded)'[Jobs])/25.0)*25,
IF(SUM('LA level data (unrounded)'[Jobs])<1000,ROUND(SUM('LA level data (unrounded)'[Jobs])/50.0)*50,
IF(SUM('LA level data (unrounded)'[Jobs])<10000,ROUND(SUM('LA level data (unrounded)'[Jobs])/100.0)*100,
IF(SUM('LA level data (unrounded)'[Jobs])<25000,ROUND(SUM('LA level data (unrounded)'[Jobs])/500.0)*500,
IF(SUM('LA level data (unrounded)'[Jobs])<250000,ROUND(SUM('LA level data (unrounded)'[Jobs])/1000.0)*1000,
ROUND(SUM('LA level data (unrounded)'[Jobs])/5000.0)*50000)
I often get this error when I have misplaced (or missed out) a bracket, and so it things you haven't given a 'then' or 'else' statement.
Make sure you haven't missed a bracket after ROUND(SUM())