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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Adrian_A
Frequent Visitor

Group data in power query

Hello All!

 

As most here I am hoping for some assistance. I to, am vary new to power Bi and its features. My goal is to group data in Power Query to look just like the below. I belive this is done through Grouping and also calculation? I pull the data in this format, when imported but just ends up like a plane table no filters or pivots ?

The goal is to segminet data accorss the Board to show just like the below.

-Grouped by Job# based on "Builder"

- Calculate "Number Of Jobs" by "Builder"

- Avg of "Days Since Sold"

- Avg of "Projected Sold to Close"

- Appear as the Below

 

I have 411 line that i would need to Transform in this way. 

Job#BuilderDays Since SoldProjected Close Date
00001-001AndyNull 

00001-010

AndyNull 
00001-014Andy608686
00001-020Andy741810
00001-025Andy559602
00001-032Andy699714
                                    
                        Number of Jobs                       6Total Avg ?Total Avg?
00010-002Smith328436
00010-025SmithNullNull
00010-013Smith203368
00010-019Smith307481
00010-056Smith349524
00010-033Smith236448
00010-078Smith219370
00010-024Smith207372
    
                       Number Of jobs                     8Total Avg?Total Avg?
    
    
    

 

 Thanks agian !!

9 REPLIES 9
wdx223_Daniel
Super User
Super User

NewStep=Table.Combine(Table.Group(PreviousStepName,"Builder",{"n",each _&#table(Table.ColumnNames(_),{{"Number Of Jobs",Table.RowCount(_),List.Average([Days Since Sold]),List.Average([Projected Close Date])}})})[n])

Sri_phani
Helper III
Helper III

Oh, I get it, you are looking for the exact view in Power Query, then I don't think it is possible. Why because every aggregation that you do will create a column or transform the current one. So you can't create exact view that you are expecting. 

Ok thankyou.

So then, would thier be away to achieve somthing similar? Lets say, in a drill down fashion?

Maybe drill down from a job# ? or would that end up creating a rediculous amount of colmns?

Sri_phani
Helper III
Helper III

Hi Adrian, 

 

You can use an option called "Group by", which will have advanced options to calculate as per your requirement. 

 

Sri_phani_0-1670254197329.png

 

You can add multiple groupings along with multiple calculations as mentioned below. 

Sri_phani_1-1670254268135.png

 

Also, It appears any grouping creates a new column rather than displaying in same columns

 

Thanks for your help!

 

Could you tell me what i would use to identify the Builder Column?

 

I Think i have that piece down however, when i attempt, the "Builder Colmn aways comes back with Error. I am usewr its not being identified as a value but then not sure how to identify value with words.

Could you be able to give me some sample data. I will look into it by checking the data. (You can remove or change the data if there is any confidential information)

Thankyou soo much for taking the time to look at this

Absolutley,

Sample Data below:

https://mega.nz/file/7UxxHbAK#15pI4F-LrbsUO1xWq5pfvPZTjBDB4gZz7j0tSVgqomk

Adrian_A
Frequent Visitor

Apologies the Number 6, and 8 where supposed to line up with the "Builder" Column

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors