Forum Discussion

EugenioBeltran's avatar
EugenioBeltran
Frequent Visitor
3 years ago
Solved

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

  • 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? 

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

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

  • Hi, EugenioBeltran 

     

    You can try the following methods.
    Sample data:

    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)

    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.

5 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, EugenioBeltran 

     

    You can try the following methods.
    Sample data:

    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)

    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.

  • 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? 

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

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

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