Add Conditional Column

ermias
Posts: 1
Joined: Fri Aug 17, 2018 9:27 pm

Add Conditional Column

Postby ermias » Fri Aug 17, 2018 9:31 pm

Hi Everyone,
I have a feeling that what i am going to ask here might not be possible at all but i am just here to give it a try in case there is someone out there with exceptional talent.
The question is, i want to add a conditional column for duplicates in my query. The code i am looking for would look a bit like the following when its done..
If(Item ID = 5127730, SKU Description = "HANDUA Keg 30l", "HANDUA 24x33cl","HANDUA Export LN 24x33cl" else if Item ID = 5127690, SKU Description = "TUXIDO Regular Export LN 24x33cl","TUXIDO Regular LN 24x33cl","TUXIDO Regular EURO 20x50cl","TUXIDO Regular Keg 30L","TUXIDO Special XLN 20x50","TUXIDO Regular EURO 20x50cl")
This means if the system founds Item ID 5127730 many times, i want it to assign the sku description for each duplicate item ID evenly so the final output would look something like the one i have attached here. Now, i know that there is just a really narrow possibility for it to work but just to try...
Thanks for the help!
Attachments
one ID vs many SKU.JPG
one ID vs many SKU.JPG (36.83 KiB) Viewed 328 times

Kamran_bsh
Posts: 10
Joined: Wed Jul 25, 2018 8:54 am
Location: England

Re: Add Conditional Column

Postby Kamran_bsh » Sat Aug 18, 2018 8:41 am

Please upload the file. There might be a solution. I will give it a try :-) besides Matt might reply if he gets a chance, am sure he would know a way to do this.

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

Re: Add Conditional Column

Postby MattAllington » Sun Aug 19, 2018 9:40 am

So you are saying you want to concatenate the descriptions from multiple duplicates into 1? I hunk this is doable. Please post some sample data in a spreadsheet and I will take a look.
Matt Allington is Self Service BI Consultant, Trainer and Author of the Book "Supercharge Power BI".
Power BI Training


Return to “Power Query”

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron