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
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 I
Helper I

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 I
Helper I

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
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.

Top Solution Authors