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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gianfranco
New Member

Round up

Hi,

 

coudl you please help me with the following.

I have a column that makes the below calculation:

N_Pellicole = 'commesse'[Strati] + ( ('commesse'[N_Stampe] / LOOKUPVALUE('Formati'[N_Formati];'Formati'[Formati_xls];'commesse'[formato] ) ))
 
I need to roundup this part 
( ('commesse'[N_Stampe] / LOOKUPVALUE('Formati'[N_Formati];'Formati'[Formati_xls];'commesse'[formato] ) ))
 
but return always an error? 
 
Thanks in advance 
Gianfranco 
1 ACCEPTED SOLUTION

Hi, 

i tried to wrap with an IFERROR and effectively the calcualtion works. 

I doublechecked in xls that the output figures are consistent.

 

just one small point: what does it mean when in the formula bar the box at the end is half grey and half red ? 

 

Thanks

gianfranco 

 

Thanks

G

View solution in original post

6 REPLIES 6
rsbin
Super User
Super User

@Gianfranco ,

Dax has a ROUNDUP function.  You can google this to get more info.  But try something like this:

ROUNDUP( ('commesse'[N_Stampe] / LOOKUPVALUE('Formati'[N_Formati];'Formati'[Formati_xls];'commesse'[formato] ) ), 0)

// This should roundup to the nearest whole number.  Replace the 0 to indicate how many decimal places you want to round to.

Hope this helps.

Regards,

Hi

 

thanks - I tried but I always have an error 

The error returned is the argument of the function roundup has not correct datatype or the result is too big or too low

 

If you can help me thanks in avance!

G

 

@Gianfranco ,

In order to help you better, please post a few rows of sample data for each of your two tables 'Comesse' and 'Formati'.  Do not include any sensitive data.

 

Hi,

 

thanks for the suggestion to post some data.

I realised that it could be in some cases that the first argument of the division coudl be 0. 

this could affect the formula and generate the error ? 

 

Thanks

g

@Gianfranco ,

If the first argument, commesse'[N_Stampe], is 0, this will evaluate to a 0, so I don't believe that is the issue.  0/anything = 0

If the second part (the denominator) is 0 then this will throw an error.  You can wrap the entire thing with an IFERROR.  Perhaps your LOOKUPVALUE could be failing somewhere.

 

Hi, 

i tried to wrap with an IFERROR and effectively the calcualtion works. 

I doublechecked in xls that the output figures are consistent.

 

just one small point: what does it mean when in the formula bar the box at the end is half grey and half red ? 

 

Thanks

gianfranco 

 

Thanks

G

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.