Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Help with a conditional

Hello! In my table I have three categories of product and quantities: Category Quantity Premium 50 Basic 30 Extra Costs 20 I need to create a new column "Quantit...
  • Samarth_18's avatar
    Samarth_18
    4 years ago

    It seems you are trying to create a measure not column. In that case you can use this code:-

    Quantity2 =
    IF (
        SELECTEDVALUE ( 'SaleProducts'[Product Category] ) = "Premium",
        SELECTEDVALUE ( 'SaleProducts'[Quantity] ) * 2,
        SELECTEDVALUE ( 'SaleProducts'[Quantity] ) * 1
    )