Forum Discussion

Matthew_Theis's avatar
Matthew_Theis
Advocate II
8 years ago
Solved

Problems with LookupValue

Hello Everyone,   Thanks for the help in advance.  I'm trying to utilize LOOKUPVALUE to provide me with the previous weeks' price for any given PartNumber and Distributor.  I don't want to hardcode...
  • Matthew_Theis's avatar
    Matthew_Theis
    8 years ago

    I was able to come up with a solution to my problem.  Here is the query that I used...

    Previous Price =
    CALCULATE(
    SUM('Octopus FindChipsExport'[Price]),
    FILTER(
    ALLSELECTED('Octopus FindChipsExport'),
    'Octopus FindChipsExport'[DateOfImport] = SELECTEDVALUE('Octopus FindChipsExport'[DateOfImport]) - 7
    && 'Octopus FindChipsExport'[Distributor] = SELECTEDVALUE('Octopus FindChipsExport'[Distributor])
    && 'Octopus FindChipsExport'[PartNumber] = SELECTEDVALUE('Octopus FindChipsExport'[PartNumber])
    )
    )