Forum Discussion
Anonymous
8 years agoNot applicable
calculate category column using nested IF
I want to calculate following column. Sales Parent type Franchise Retail Corporate This are the other column I should filter to evaluate the sales parent type as franchise or retail or corpo...
GilbertQ
8 years agoSuper User
Hi Anonymous
I would complete this in the Query Editor using the Custom Column.
In doing it in this way it would come into your Power BI model with your definitions already defined.
A rough sample would be the following:
IF(
('Query1'[WarehouseID]= '1' and 'Query1'[ParentAccountID] = 2151 and 'Query1'[InvoiceStatusID]= 'IN' and 'Query1'[AccountLevel]= 3') or
('Query1'[WarehouseID]= '2' and 'Query1'[ParentAccountID] = 8351 and 'Query1'[InvoiceStatusID]= 'IN' and 'Query1'[AccountLevel]= '3') or
('Query1'[WarehouseID]= '3' and 'Query1'[ParentAccountID] = 1251 and 'Query1'[InvoiceStatusID]= 'IN' and 'Query1'[AccountLevel]= '3')) then Retail