Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

An impossibly simple division

Link to PBIX-file: ShopInfo

 

Hi all!

 

I could use some help wrapping my head around the following issue:

 

I have three tables in my model:

 

 

They look like:

 

Now I've created the following table using these tables:

 

Now, I want another column in this table that will divide the number of Employees over the YearlySales. So..

 

ProductIDEmployeesYearlySalesYearlySales per Employee
348103000300
348203000150
34850300060
53251000200
532101000100
92451500300
924101500150
92420150075
92450150030

 

In the table, I have ticked the 'Don't Summarize' options for the columns 'Employees' and 'YearlySales'.

 

But as I try to create a measure or calculated column in the ShopInfo-table which just divides both values, the formula editor requires me to enforce some kind of aggregation (max, min, sum, etc...) before being able to include the YearlySales. Which in turn messes up the calculation.. I tried a lot of variations, but no success. ðŸ˜ž

 

Any ideas on how to solve this? I'm even questioning if I should create a measure or calculated column. Help is very much appreciated. 

  • Hi Anonymous 

    in depends on your use case scenario

    but in the most common case you can try a measure

    YearlySales per Employee = 
    DIVIDE(
    CALCULATE(MIN(Products[YearlySales])),
    CALCULATE(MIN(ShopInfo[Employees]))
    )

2 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    in depends on your use case scenario

    but in the most common case you can try a measure

    YearlySales per Employee = 
    DIVIDE(
    CALCULATE(MIN(Products[YearlySales])),
    CALCULATE(MIN(ShopInfo[Employees]))
    )
  • camargos88's avatar
    camargos88
    Community Champion

    Hi Anonymous ,

     

    You need to change the direction of relationship to both between Shops and ShopInfo.

     

    Also create this measure:

     

    Measure = DIVIDE(SUM(Products[YearlySales]); SUM(ShopInfo[Employees]))
     
     
    Ricardo