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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

GroupBy Function Date Data Type Columns Change To Text Data Type

Whenever I use the "GroupBy" function on a non Date data type column and breakout the columns, any Date data type columns within that query change to Text data type 😬😠😮

I am then having to change the Date data type columns back. Creating another applied step!!

Is this just me being daft or has anyone else experienced this PBI "feature"?

Is there any way around this?

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Do you mean group by on a column then expand the table column to show other columns? Based on my test, this will not change column data types. You can paste below codes to a blank query to see my result.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwtLsnMU9JRcgRiM30jfSMDI0Mg00gpVgdD1hiHrBNY1gSvrClMFizpkpiTk1gMlzSESRqgyqI7yhSbtDEuaWc0Z5lis9oUWToWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Type = _t, Date = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Date", type date}, {"Value", Int64.Type}, {"Type", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Region", "Type"}, {{"All", each _, type table [Region=nullable text, Type=nullable text, Date=nullable date, Value=nullable number]}}),
    #"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", {"Date", "Value"}, {"Date", "Value"})
in
    #"Expanded All"

 

If I don't understand the issue correctly, can you share your codes or screenshots to help me understand it better? I'm a little confused about the description "breakout the columns"...😬

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you for responding.

I think I may have had some nulls in my date columns 😕

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Do you mean group by on a column then expand the table column to show other columns? Based on my test, this will not change column data types. You can paste below codes to a blank query to see my result.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WciwtLsnMU9JRcgRiM30jfSMDI0Mg00gpVgdD1hiHrBNY1gSvrClMFizpkpiTk1gMlzSESRqgyqI7yhSbtDEuaWc0Z5lis9oUWToWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Region = _t, Type = _t, Date = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Region", type text}, {"Date", type date}, {"Value", Int64.Type}, {"Type", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Region", "Type"}, {{"All", each _, type table [Region=nullable text, Type=nullable text, Date=nullable date, Value=nullable number]}}),
    #"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", {"Date", "Value"}, {"Date", "Value"})
in
    #"Expanded All"

 

If I don't understand the issue correctly, can you share your codes or screenshots to help me understand it better? I'm a little confused about the description "breakout the columns"...😬

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.