Forum Discussion
Lexi
4 years agoFrequent Visitor
Nested if statements/Switch function?
Howdy! I need some direction from you nice guys 😊 I am new to Powerbi and I am trying to get to a solution to my issue. I have a dataset and I am assigning groups to our customers Custome...
- 4 years ago
Lexi can you try this
Column = VAR _home = SELECTCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[CustID] ) ), 'Table'[CustID], 'Table'[Home] ), "cust", [CustID], "country", [Home] ) VAR _shipping = SELECTCOLUMNS ( SUMMARIZE ( CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[CustID] ) ), 'Table'[CustID], 'Table'[Shipping] ), "cust", [CustID], "country", [Shipping] ) VAR _intersect = INTERSECT ( _home, _shipping ) VAR _except = EXCEPT ( _shipping, _home ) RETURN IF ( MAXX ( _except, [country] ) = BLANK (), MAXX ( _intersect, [country] ), MAXX ( _except, [country] ) )which generates this