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
I_Like_Pi
Resolver II
Resolver II

Group-by (Calculated column), Expression.Error: the 'offset' argument is out of range.

I have a Data set that is missing a unique joining field. In order to create the field I built a calculated column that aggregates a field with the last 4 digits of a second field. (i.e.   UniRec = Text.Trim([Name] & Text.Range([Redacted],12,4)

Redacted would be unique but we purposely XXXX the first 12 values like you see in a credit card (coincidently 16 characters). 

The column looks right... but when I use it in a group by I get the Expression.Error above.

 

I am playing with it as I post and just noticed that the Data type at the top is ABC/123 I converted it to text, and now it works. So if you find this post, I just learned that the data type matters for group by.

What I dont know is why. If anyone out there understands why it matters. Please enlighten me or I am destined to repeat.

1 ACCEPTED SOLUTION

 

Unfortunately I cannot post the associated file. But I am more interested in understanding if there are datatype limits on the "grouping" columns. Reading some other posts I now know that you should really specify any of the columns that PQ leaves undefined (i.e. ABC 123) or subsequent actions may treat it as text or a number inconsistently depending upon the data that shows up. As is the case here (the column datatype was not defined).

 

The error seems vague to me I wondered if there were other circumstances (data types) where a Grouping step would throw such an error.

 

Regardless, thanks for you interest Xiaoxin.

 

John

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @I_Like_Pi,

 

Can you please share a pbix file for test?

Regards,

Xiaoxin Sheng

 

Unfortunately I cannot post the associated file. But I am more interested in understanding if there are datatype limits on the "grouping" columns. Reading some other posts I now know that you should really specify any of the columns that PQ leaves undefined (i.e. ABC 123) or subsequent actions may treat it as text or a number inconsistently depending upon the data that shows up. As is the case here (the column datatype was not defined).

 

The error seems vague to me I wondered if there were other circumstances (data types) where a Grouping step would throw such an error.

 

Regardless, thanks for you interest Xiaoxin.

 

John

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.