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
Oros
Post Partisan
Post Partisan

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])

 

 

Oros_0-1627672824826.png

 

1 ACCEPTED SOLUTION

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

6 REPLIES 6
mahoneypat
Employee
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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi @mahoneypat ,

 

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

 

Oros_0-1627850323940.png  

Oros_2-1627850391440.png

 

Oros_1-1627850354584.png

 

 

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi @mahoneypat ,

 

Thank you so much.  I checked the table relationships and pulled the product number from a related table and everything works now.  Thanks again.

mahoneypat
Employee
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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.

 

Oros_0-1627842997039.png

Oros_1-1627843019839.png

 

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.