Forum Discussion

dswinden's avatar
dswinden
Helper II
3 years ago
Solved

Calculated Column Based on Two OTHER Related Tables (three tables total)

Hello!   I am trying to connect a sales source to a date table, and a price table.  (example below) I am trying to determine what the unit price was on a given week for a SKU so that I can calcu...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    3 years ago

    Hi,

    Create a relationship (Many to one and Single) from the Date column of the Date table to the Date column of the Calendar Table.  Write these calculated column formulas

    Week start = =RELATED('Calendar'[Week Start])
    Unit price = CALCULATE(MAX(Finance_pricing[Net Revenue Unit Price]),FILTER(Finance_pricing,Finance_pricing[SKU Number]=EARLIER(Data[SKU Number])&&Finance_pricing[Week Start]=EARLIER(Data[Week start])))

    Hope this helps.