Forum Discussion
Syndicate_Admin
4 years agoAdministrator
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...
- 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 )
Syndicate_Admin
4 years agoAdministrator
My Table is called "SaleProducts", the column is "Product Category", when I try to write the function the table is not displayed:
Samarth_18
4 years agoCommunity Champion
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
)