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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
DSR
Resolver I
Resolver I

Groupby is NOT showing the column names with their types only stating " type table"

Hello, Your help is appreciated.

In Power query when I use Groupby (in my excel 2016 pro) the answer at the end of the code show " type table" and NOT listing the columns and their types. When I have several or tens of columns how to list them after " type table" with their types

I saw some videos (RICK DE GROOT) they show the columns and their types (after  "type table" ) saving the time, when expanding the next step of Groupby. No additional change type step.

 

Here is the steps and its result my Excel 2016 pro is getting:

= Table.Group(#"Changed Type", {"Case.CC.EEName"}, {{"Details", each fx_RefertoPreviousRunningCalc("Calculated Tenure", _, "Index.inGrp", "Yr Move Out", "NoEE") , type table}})

 

Rick de Groot gets:

Got the following:

= Table.Group(#Sorted Rows", {"Product},{{"Details", each_, type table [Date=nullable date, Pruduct = nullable text, Amount= nullable number]}})

using Power bi

at 9.23 minute at: https://www.youtube.com/watch?v=ShnWkb6e0jE

Create a Running Total by Category in Power Query

Table.Group(#"Changed Type", {"Case.CC.EEName"}, {{"Details", each fx_RefertoPreviousRunningCalc("Calculated Tenure", _, "Index.inGrp", "Yr Move Out", "NoEE") , type table}})

Is is related to setting up Excel power query or Version of excel or might be in power query... or...?

 

how can I after  "type table" get "[Case.CC.EEName=nullable text, Index.inGrp = nullable text, .....NoEE= nullable number....]}})

Thanks

1 ACCEPTED SOLUTION

HelloIbendlin,

How go i get name of columns listed with their original type before grouping, during the Table.Group, as

Rick de Groot gets:

Got the following:

= Table.Group(#Sorted Rows", {"Product},{{"Details", each_, type table [Date=nullable date, Pruduct = nullable text, Amount= nullable number]}})

using Power bi

at 9.23 minute at: https://www.youtube.com/watch?v=ShnWkb6e0jE

Create a Running Total by Category in Power Query

Table.Group(#"Changed Type", {"Case.CC.EEName"}, {{"Details", each fx_RefertoPreviousRunningCalc("Calculated Tenure", _, "Index.inGrp", "Yr Move Out", "NoEE") , type table}})

Is is related to setting up Excel power query or Version of excel or might be in power query... or...?

 

how can I after  "type table" get "[Case.CC.EEName=nullable text, Index.inGrp = nullable text, .....NoEE= nullable number....]}})

Thanks

View solution in original post

7 REPLIES 7
ronrsnfld
Super User
Super User

 Execute the Table.Group function from the UI and select "All Rows" for the operation.

       Power Query will generate the type table[...] with the existing columns and types.

 

Then you can enter the Advanced Editor and edit to create your custom aggregation.

 

 

v-veshwara-msft
Community Support
Community Support

Hi @DSR ,

Thanks for reaching out to the Microsoft Fabric Community.

Just checking in to see if your issue is resolved by now. If not, please consider the following:

When using a custom function inside a Table.Group operation, as in your case with fx_RefertoPreviousRunningCalc, Power Query doesn’t auto-generate the column schema in the type table [...] format. That behavior is only available when you select All Rows directly in the UI, which Power Query handles behind the scenes, as previously noted by @ZhangKun.

 

To include the detailed column schema during grouping without manually typing it out, you can leverage the Value.Type function to extract the structure of your original table before grouping:

 

Table.Group(YourTable, {"GroupColumn"}, {{"Details", each fx_RefertoPreviousRunningCalc(...), Value.Type(YourTable)}})


This  ensures the grouped column preserves the column names and data types from the original table.

 

In case you resolved it in a different way, please feel free to share your approach here, it could help others facing the same issue.

If any of the responses in this thread were helpful, kindly mark them as Accepted Solution to assist others with similar queries. A kudos would also be appreciated.

 

Thank you.

ZhangKun
Super User
Super User

I think i understand your question. you'd know "type table" equal "type table [...]". this means that when you use "type table", it will override the type of the original table. 

you can try to expanding three column in following code and see the difference:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTJSitWBsEzALCMgywzMMgayLOAsS6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [A = _t, B = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"A", type text}, {"B", Int64.Type}}),
    GroupBy1 = Table.Group(ChangedType, {"A"}, {{"Rows", each _, type table}}),
    GroupBy2 = Table.Group(ChangedType, {"A"}, {{"Rows", each _, type table [A = text, B = number]}}),
    GroupBy3 = Table.Group(ChangedType, {"A"}, {{"Rows", each _, Value.Type(ChangedType)}})
in
    GroupBy3

Thank you Zhanghun,

How go i get name of columns listed with their original type before grouping, during the Table.Group, as

Rick de Groot gets:

Got the following:

= Table.Group(#Sorted Rows", {"Product},{{"Details", each_, type table [Date=nullable date, Pruduct = nullable text, Amount= nullable number]}})

using Power bi

at 9.23 minute at: https://www.youtube.com/watch?v=ShnWkb6e0jE

Create a Running Total by Category in Power Query

Table.Group(#"Changed Type", {"Case.CC.EEName"}, {{"Details", each fx_RefertoPreviousRunningCalc("Calculated Tenure", _, "Index.inGrp", "Yr Move Out", "NoEE") , type table}})

Is is related to setting up Excel power query or Version of excel or might be in power query... or...?

 

how can I after  "type table" get "[Case.CC.EEName=nullable text, Index.inGrp = nullable text, .....NoEE= nullable number....]}})

Thanks

"how can I after  "type table" get "[Case.CC.EEName=nullable text, Index.inGrp = nullable text, .....NoEE= nullable number....]}})"

selected "All Rows", and power query will add detail type.

ZhangKun_0-1740456078917.png

 

lbendlin
Super User
Super User

You are using a custom grouping function. That means you also need to provide the custom meta data in that step - or you do it in subsequent steps when you use the aggregation columns.

HelloIbendlin,

How go i get name of columns listed with their original type before grouping, during the Table.Group, as

Rick de Groot gets:

Got the following:

= Table.Group(#Sorted Rows", {"Product},{{"Details", each_, type table [Date=nullable date, Pruduct = nullable text, Amount= nullable number]}})

using Power bi

at 9.23 minute at: https://www.youtube.com/watch?v=ShnWkb6e0jE

Create a Running Total by Category in Power Query

Table.Group(#"Changed Type", {"Case.CC.EEName"}, {{"Details", each fx_RefertoPreviousRunningCalc("Calculated Tenure", _, "Index.inGrp", "Yr Move Out", "NoEE") , type table}})

Is is related to setting up Excel power query or Version of excel or might be in power query... or...?

 

how can I after  "type table" get "[Case.CC.EEName=nullable text, Index.inGrp = nullable text, .....NoEE= nullable number....]}})

Thanks

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors