cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors