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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
EugenioBeltran
Frequent Visitor

Round and divide DAX formula

Hello, i am looking for a DAX formula that combines divide and round, in example i ha tried round(divide(table1[cases],table1[cases per pallet],0) but it gives me an errors

 

Thank you for your help

3 ACCEPTED SOLUTIONS
andhiii079845
Solution Sage
Solution Sage

Do you use this as a measure? This will not work. You use columns without a minx,maxx or sumx...
Or do you use it as a calculated column? 





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

Proud to be a Super User!




View solution in original post

andhiii079845
Solution Sage
Solution Sage

round(divide(table1[cases],table1[cases per pallet],0) a bracket is missing. 

round(divide(table1[cases],table1[cases per pallet]),0)





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

Proud to be a Super User!




View solution in original post

v-zhangti
Community Support
Community Support

Hi, @EugenioBeltran 

 

You can try the following methods.
Sample data:

vzhangti_0-1678341270511.png

Measure = ROUND(DIVIDE(SELECTEDVALUE('Table'[Cases]),SELECTEDVALUE('Table'[Cases per pallet])),0)
Measure 2 = ROUND(DIVIDE(SUM('Table'[Cases]),SUM('Table'[Cases per pallet])),0)

vzhangti_1-1678341338199.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @EugenioBeltran 

 

You can try the following methods.
Sample data:

vzhangti_0-1678341270511.png

Measure = ROUND(DIVIDE(SELECTEDVALUE('Table'[Cases]),SELECTEDVALUE('Table'[Cases per pallet])),0)
Measure 2 = ROUND(DIVIDE(SUM('Table'[Cases]),SUM('Table'[Cases per pallet])),0)

vzhangti_1-1678341338199.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

andhiii079845
Solution Sage
Solution Sage

round(divide(table1[cases],table1[cases per pallet],0) a bracket is missing. 

round(divide(table1[cases],table1[cases per pallet]),0)





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

Proud to be a Super User!




EugenioBeltran
Frequent Visitor

It we works if I do =[cases]/[cases per pallet] but it does not work when I add round([cases]/[cases per pallet],0)

andhiii079845
Solution Sage
Solution Sage

Do you use this as a measure? This will not work. You use columns without a minx,maxx or sumx...
Or do you use it as a calculated column? 





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

Proud to be a Super User!




I use it as a measure, , row by row 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!