Forum Discussion

astroadmin's avatar
astroadmin
New Member
6 years ago
Solved

DAX - Calculate with Filter using table column value

Hi Everyone,   I am trying to make a DAX function work. For some reason, searching for hours couldnt find a solution. Any help will be greatly appriciated.   Result = CALCULATE(      SUM(DATA[E...
  • Greg_Deckler's avatar
    6 years ago

    If this is a column, you should be able to use:

     

    Result =
    CALCULATE(
         SUM(DATA[Estimated Annual Revenue]),
         FILTER (
              ALL ( DATA[BusinessUnit] ), DATA[BusinessUnit] = EARLIER([BU])
         )
    )

     

    If it is a measure, you could use:

    Result =
    VAR __BU = MAX('DATA'[BU])
    RETURN
    CALCULATE(
         SUM(DATA[Estimated Annual Revenue]),
         FILTER (
              ALL ( DATA[BusinessUnit] ), DATA[BusinessUnit] = __BU
         )
    )