Power BI, IF condition



Create a calculated column that uses an IF function

Stores table has a column named Status, with values of "On" for active stores and "Off" for
inactive stores, which we can use to create values for our new Active StoreName column. Your DAX formula will use the logical IF function to test each store's Status and return a particular value depending on the result. If a store's Status is "On", the formula will return the store's name. If it’s "Off", the formula will assign an Active
StoreName of "Inactive".

1. Create a new calculated column in the Stores table and name it Active StoreName in the formula bar.

DAX Expression:
Active StoreName = IF([Status]="On",[StoreName],"Inactive")

Store Table fields:



Final Output:




Comments