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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
Super User
Super User

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
Super User
Super User

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
Super User
Super User

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
Super User
Super User

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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