Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Diving two columns from different tables that cannot be summed up

Hi all, I have a master table for products with their expiry date(in days). For eg 180 days I have a stocks table for products with their manufacture date.(same products will have different manufa...
  • Cmcmahan's avatar
    7 years ago

    You can totally create a measure, just don't create one that sums up the values.

     

    I'm assuming you have some sort of productID that relates from the master table to the stocks table.  

     

    Without knowing your table structure, your measure would look something like this:

     

    Expiration% =  DATEDIFF(TODAY(), SELECTEDVALUE(Stocks[ManufactureDate]), DAY)/ SELECTEDVALUE(Master[ExpiryLength]) 

    Put this in a table with your list of items from the Stocks table, and it should give you correct values.