cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Adavanced Editor help

I have the following code which takes population data, groups it by field of study and catches only those that are 500K or higher. 

Is there a way to do this, so that the filtered table is not grouped, in other words still showing all of the rows and colums before the grouping occured? Thanks in advance!

 

#"Grouped Rows" = Table.Group(#"Sorted Rows", {"Major Field of Study"}, {{"Field Total", each List.Sum([Value]), type number}}),
#"Filtered Rows1" = Table.SelectRows(#"Grouped Rows", each [Field Total] >= 500000)

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Adavanced Editor help

While Dales solution will work, on large volume of data it might soon become slow. Then you can use this technique instead: Just add another column in your Group-operation, that adds all the rows back as they were and expand that column afterwards: 

 

image.png

 

Happy and healthy new year everyone 🙂

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

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

4 REPLIES 4
Super User
Super User

Re: Adavanced Editor help

Invoking @ImkeF, if anyone can answer this, she can. 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

v-jiascu-msft Super Contributor
Super Contributor

Re: Adavanced Editor help

Hi @Anonymous,

 

It seems you'd like to add a column. Please try the formula below. 

let current = [Major Field of Study] in List.Sum(Table.SelectRows(#"Sorted Rows", each [Major Field of Study] = current)[Value])

Adavanced-Editor-help

 

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Adavanced Editor help

While Dales solution will work, on large volume of data it might soon become slow. Then you can use this technique instead: Just add another column in your Group-operation, that adds all the rows back as they were and expand that column afterwards: 

 

image.png

 

Happy and healthy new year everyone 🙂

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

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




View solution in original post

Highlighted
Anonymous
Not applicable

Re: Adavanced Editor help

Thank you guys for taking the time to respond to this - I will try out both of these solutions.

 

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: 269 members 2,529 guests
Please welcome our newest community members: