Forum Discussion

Tybaal's avatar
Tybaal
Icon for Helper II rankHelper II
5 years ago
Solved

Make a value as negative depending on a parameter from another table

Hi everyone,    I'd like to value from my fact table negative if a field from a dimension table has a certain value. For exemple :  If ('Dimension Type'[Type] = "A", SUM('Fact sales'[Amount] * -1...
  • amitchandak's avatar
    5 years ago

    Tybaal , something like this

    if (max('Dimension Type'[Type]) = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount])))

    or

    sumx(values('Dimension Type'[Type]) ,if ('Dimension Type'[Type] = "A", SUM('Fact sales'[Amount]) * -1, IF('Dimension Type'[Type] = "B", SUM('Fact sales'[Amount]))))