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

Change granularity

Hello, I am working on a project to analyse certain customer opportunities and I want to analyse which employees are available per opportunity. Right now I have a table "new_candidates" with employee id's in (see sample data), the problem is that there are multiple employees in one row in the same column. So right now my granularity is one row per opportunity. I would like to change this to 1 row per employee opportunity/availability.

 

Sample data:

Capture.PNG

 

 

data right now:

start dateTopicCandidatesDescriptioncloudprobability
01/05/2020data lake10000003, 10000006, 10000009Description 11100
24/04/2020data integration10000010, 100000000Description 2270
05/05/2020Business Intelligence10000008Description 3190

 

Desired data:

start dateTopicCandidatesDescriptioncloudprobability
01/05/2020data lake10000003Description 11100
01/05/2020data lake10000006Description 11100
01/05/2020data lake10000009Description 11100
24/04/2020data integration10000010Description 2270
24/04/2020data integration100000000Description 2270
05/05/2020Business Intelligence10000008Description 3190

Any ideas?

1 ACCEPTED SOLUTION

Good Point  this can be handled by creating a custom column , with text . split function .  Refer the following M code for your reference . 

 Reference : https://www.youtube.com/watch?v=9krfJLv8ENk

let
Source = Excel.Workbook(File.Contents("...Documents\Smap.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Table1_Table,{{"tart date", type date}, {"Topic", type text}, {"Candidates", type text}, {"Description", type text}, {"cloud", Int64.Type}, {"probability", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Split Candidates", each Text.Split([Candidates],",")),
#"Expanded Split Candidates" = Table.ExpandListColumn(#"Added Custom", "Split Candidates")
in
#"Expanded Split Candidates"

View solution in original post

8 REPLIES 8
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

You can split this column like:

 

Capture.PNG

 

Capture 2.PNG

 

If you consider it as a solution, please mark as a solution and kudos.

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Yes I know but that isn't what I am looking for. That way when I have a mapping table I still can't connect to that table. I need a row per employee for each opportunity

Hi @Anonymous ,

 

Sorry, I didn't get what you need.

Can you give more details ?

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Hi, @camargos88 sure. Right now I have data like this:

 

start dateTopicCandidatesDescriptioncloudprobability
01/05/2020data lake10000003, 10000006, 10000009Description 11100
24/04/2020data integration10000010, 100000000Description 2270
05/05/2020Business Intelligence10000008Description 3190

 

Where I would like to go to would look something like:

start dateTopicCandidatesDescriptioncloudprobability
01/05/2020data lake10000003Description 11100
01/05/2020data lake10000006Description 11100
01/05/2020data lake10000009Description 11100
24/04/2020data integration10000010Description 2270
24/04/2020data integration100000000Description 2270
05/05/2020Business Intelligence10000008Description 3190

 

Does this makes sense?

Here is what might work . Split  the columns by delimiter . Select the columns that you created by split and unpivot it .   You should get the desired result 

Anonymous
Not applicable

Hi @mitsu, this indeed worked, but isn't future proof. What happen when in future I have 4 possible candidates? then I would have to transform data again and select the 4th column as well?

Good Point  this can be handled by creating a custom column , with text . split function .  Refer the following M code for your reference . 

 Reference : https://www.youtube.com/watch?v=9krfJLv8ENk

let
Source = Excel.Workbook(File.Contents("...Documents\Smap.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Table1_Table,{{"tart date", type date}, {"Topic", type text}, {"Candidates", type text}, {"Description", type text}, {"cloud", Int64.Type}, {"probability", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Split Candidates", each Text.Split([Candidates],",")),
#"Expanded Split Candidates" = Table.ExpandListColumn(#"Added Custom", "Split Candidates")
in
#"Expanded Split Candidates"

Anonymous
Not applicable

Cool, thanks alot!

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.