Forum Discussion

Oros's avatar
Oros
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Divide a column by a measure

Hello.

 

I divide a column (from a table) by a measure (from another table) and it does not seem to be working.  Some rows work but most do not divide well. Inventory divided by Sales per week.

 

Any ideas?  Thanks.

 

 

WEEKS TO SELL = 
DIVIDE(SUM(Item_Card[Inventory]),[Sales/Week])

 

 

 

  • I assumed you had other columns in your table visual.  Is that the case?  Either way, I'm sure you already put that back to Don't Summarize.  What are those columns?  And how do the table(s) they are from relate to your other tables?  More info about your model is needed to troubleshoot further.  The default aggregation was potentially a quick fix (that didn't work).

     

    Pat

6 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    In your visual, do you have an aggregation on your Inventory column?  I'm guessing it's set to Average, Min, or Max.  Try setting it to Sum to match the math in your measure.

     

    Pat

    • Oros's avatar
      Oros
      Icon for Post Prodigy rankPost Prodigy

      Hi mahoneypat ,

       

      Thank you for your quick reply.  It looks like the inventory column just comes straight from a table.  Would there be a reason why the DIVIDE measure is not working?

       

      Thanks again.

       

       

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    If you pull down the arrow on the Inventory column, what aggregation is selected?  Try choosing Sum if it is not that already.  Or choose Don't Aggregate.


    Pat

    • Oros's avatar
      Oros
      Icon for Post Prodigy rankPost Prodigy

      Hi mahoneypat ,

       

      I switched it from Don't summarize to Sum but this is what the inventory column becomes.

       

        

       

       

       

      • mahoneypat's avatar
        mahoneypat
        Icon for Microsoft Employee rankMicrosoft Employee

        I assumed you had other columns in your table visual.  Is that the case?  Either way, I'm sure you already put that back to Don't Summarize.  What are those columns?  And how do the table(s) they are from relate to your other tables?  More info about your model is needed to troubleshoot further.  The default aggregation was potentially a quick fix (that didn't work).

         

        Pat