Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help! Create a relationship when a natural one does not exist

I have a table of the cost of items where there is a starting SKU and an ending SKU. Imagine it looks like this: Starting     Ending  Cost 1000           2000      1.00 2001           3000      2...
  • VasTg's avatar
    6 years ago

    Anonymous 

     

    Create a new calculated column in Table2 and use the DAX.

     

    Column =
    CALCULATE (
        SUM ( 'Table (2)'[Units] ) * SUM ( 'Table'[Cost] ),
        FILTER (
            'Table',
            'Table (2)'[SKU Number] >= 'Table'[Starting]
                && 'Table (2)'[SKU Number] <= 'Table'[Ending]
        )
    )

    If this helps, mark it as a solution

    Kudos are nice too.