Calculated Column syntax

Anything related to PowerPivot and DAX Formuale
fb7894
Posts: 24
Joined: Thu Aug 16, 2018 11:18 pm

Calculated Column syntax

Postby fb7894 » Mon May 11, 2020 9:05 am

I need to create a calculated column with the following business rule:
If any line item within a deal has a region <> "North America" then Global, else Regional

Sample data
Deal Line Item Region
1 100 Asia
1 101 North America
2 200 Asia
2 201 Europe
3 300 Asia
3 301 North America
4 400 North America
4 401 North America

Here is what I would like the output to be:

Deal Line Item Region Global or Regional
1 100 Asia Global
1 101 North America Global
2 200 Asia Global
2 201 Europe Global
3 300 Asia Global
3 301 North America Global
4 400 North America Regional
4 401 North America Regional

MattAllington
Posts: 1091
Joined: Sun May 04, 2014 4:01 pm
Location: Sydney, Australia

Re: Calculated Column syntax

Postby MattAllington » Mon May 11, 2020 5:49 pm

I recommend you do this in Power Query. There is an add column menu that has a new conditional column button. It is pretty intuitive
Matt Allington is Self Service BI Consultant, Trainer and Author of the Book "Supercharge Power BI".
Power BI Training

fb7894
Posts: 24
Joined: Thu Aug 16, 2018 11:18 pm

Re: Calculated Column syntax

Postby fb7894 » Wed May 13, 2020 5:11 am

thanks!


Return to “PowerPivot/DAX”

Who is online

Users browsing this forum: No registered users and 7 guests