cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pinky0404 Member
Member

Pivot Column with Don't aggregate

Hi All,

 

Can somebody please help me get the expected results as below. I tried using Pivot column with Dont aggregate but i am getting an error for list

Sample Data1.PNG

Thanks in advance!!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarcelBeug Super Contributor
Super Contributor

Re: Pivot Column with Don't aggregate

Pivot without aggregation won't combine values for you, as you are expecting for the modules that are completed by Mr/s b.

 

So you can first use "Group By" to combine those values: select all columns except "Module Name", choose "Group By" with operation Maximum for column Module Name (this is just a dummy operation to have basis code generated) and adjust the code to have the module names combined.

Now you can pivot.

 

let
    Source = Table1,
    #"Grouped Rows" = Table.Group(Source, {"Name", "Email", "Module Status"}, {{"Modules", each Text.Combine([Module name],","), type text}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[#"Module Status"]), "Module Status", "Modules")
in
    #"Pivoted Column"
Specializing in Power Query Formula Language (M)

View solution in original post

4 REPLIES 4
MarcelBeug Super Contributor
Super Contributor

Re: Pivot Column with Don't aggregate

Pivot without aggregation won't combine values for you, as you are expecting for the modules that are completed by Mr/s b.

 

So you can first use "Group By" to combine those values: select all columns except "Module Name", choose "Group By" with operation Maximum for column Module Name (this is just a dummy operation to have basis code generated) and adjust the code to have the module names combined.

Now you can pivot.

 

let
    Source = Table1,
    #"Grouped Rows" = Table.Group(Source, {"Name", "Email", "Module Status"}, {{"Modules", each Text.Combine([Module name],","), type text}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[#"Module Status"]), "Module Status", "Modules")
in
    #"Pivoted Column"
Specializing in Power Query Formula Language (M)

View solution in original post

Pinky0404 Member
Member

Re: Pivot Column with Don't aggregate


Great!! Thank You Sir, It Worked Perfectly.

harish_hpe Frequent Visitor
Frequent Visitor

Re: Pivot Column with Don't aggregate

Thank you! Now, values cominng in comma separated, I would like to disply each row wise Like below

 

 

           
Source   Expected Result  Now its displaying 
Col 1Col2         
A1  ABC ABC
B2  123 1,52,63,7
C3  567    
A5         
B6         
C7         
           

 

 

Is it possible to disply values like above?

harish_hpe Frequent Visitor
Frequent Visitor

Re: Pivot Column with Don't aggregate

Thank you! Now, values cominng in comma separated, I would like to disply each row wise Like below

 

 

           
Source   Expected Result  Now its displaying 
Col 1Col2         
A1  ABC ABC
B2  123 1,52,63,7
C3  567    
A5         
B6         
C7         
           

 

 

Is it possible to disply values like above?

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 110 members 1,548 guests
Please welcome our newest community members: