Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Data Duplicacy when Splitting Column by Delimited

I have a data set that looks like the following:

 

 

CUSTOMER #      LEAD SOURCE          SALES         PROFIT

1234                     CATALOG; VIDEO      $1000        $250

 

I want to be able to capture that this customer had two originating lead sources. I split the column by the semicolon delimiter into ROWS in Query Editing and get the following data duplicacy when I try to analyze sales and profit:

 

 

CUSTOMER #      LEAD SOURCE          SALES         PROFIT

1234                     CATALOG                $1000        $250

1234                      VIDEO                     $1000          $250

 

 

In reality, I want to be able to capture that this customer came from two originating lead sources but had total  cumulative sales of $1000 and profit of $250. Does anyone have any idea how to do this correctly in Power BI?

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

Probably a few ways to do this - one way would be to count the number of delimiters you have in the lead source column, add one to it to get the number of rows you'd end up having, then making new columns dividing the sales/profit columns by that figure, what you're doing now should then work

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Have you solved your problem with the suggestion of jthomson ?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, what is your desired output?


In reality, I want to be able to capture that this customer came from two originating lead sources but had total  cumulative sales of $1000 and profit of $250. 


I have a little confused about your expected output based on your description.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jthomson
Solution Sage
Solution Sage

Probably a few ways to do this - one way would be to count the number of delimiters you have in the lead source column, add one to it to get the number of rows you'd end up having, then making new columns dividing the sales/profit columns by that figure, what you're doing now should then work

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.