Forum Discussion
evalromf
9 years agoHelper I
AND IF in conditional column
Hi, I'm trying to create a new column that should be populated with a certain number based on the contents of several other columns. What I'm looking for is something like this: If [COUNT...
wonga
9 years agoContinued Contributor
Anonymous's suggestion is through Power Query or M. If you prefer DAX, you can add a calculated column by right clicking on the table you want to add the column to and click "New Column".
The DAX formula would be something like:
MeasureName =
IF(AND([COUNTRY] = "Kazakhstan", [COMPANY] = "Alltel"), 1,
IF(AND([COUNTRY] = "Kazakhstan", [COMPANY] = "VIP"), 2, "N/A")
)
//Might need another else value, not sureevalromf
9 years agoHelper I
Tanks for the assistance, and sorry for my late feedback ...
I've managed to solve this in a completly different way - I added the ID in a data preparation stage, i.e. before the data is fed into Power BI. This is actually a more neat way to manage the IDs, as I need the data to be properly cleansed for other applications as well (i.e. not just in Power BI).