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 )
Samarth_18
4 years agoCommunity Champion
Hi Syndicate_Admin ,
You can create a column as below:-
Quantity2 = if([category] = "Premium",[Quantity]*2,[Quantity]*1)
Thanks,
Samarth
- Syndicate_Admin4 years agoAdministrator
I understand logic, but the category and Quantity columns are from my source table, they are not measured. so typing the dax function does not allow me to select the required columans
- Samarth_184 years agoCommunity Champion
Syndicate_Admin , You could try this:-
Quantity2 = if('Table'[category] = "Premium",'Table'[Quantity]*2,'Table'[Quantity]*1)- Syndicate_Admin4 years agoAdministrator
it does not allow me to select the table, it only allows me to select measurements.