Forum Discussion

SL_1983's avatar
SL_1983
Icon for Helper II rankHelper II
6 years ago
Solved

If function in a measure with multiple conditions

Good morning,   I have the following calculated columns: Number of Packages 4 pax = if('Ingredients'[Qty] <= 'Ingredients'[Package Content];1;2) Number of Packages 3 pax = if(('Ingredients'[Qty]/...
  • bheepatel's avatar
    bheepatel
    6 years ago

    Hi SL_1983 

     

    Can you try changing that measure to below (you will not need the 4 columns you created):

     

    Kostprijs Per Aangekochte Verpakking = SUMX ('Ingrediënten', ('Ingrediënten'[Verpakking Gewicht Laagste Prijs] * IF(( 'Ingrediënten'[Recept Hoeveelheid 4 Personen] / 4 ) * SELECTEDVALUE ( 'Slicer Table'[Recept  aantal Personen] ) <= 'Ingrediënten'[Verpakking Gewicht Laagste Prijs], 1, 2)) * RELATED ( 'Product'[Goedkoopste Prijs] ))

     

    Hope that helps!