Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everybody,
i'm new in this forum but I always found your Q&A very usefull for my job.
I'm dealing with this issue since a while, but I was not able to find a solution so I hope you will help me.
I don't understand an error that appear when I try to "group by" my dataset.
The error say "expression.Error: not possible to apply operator - to type text and text", but the group by function is done without appling any mathematical operation, is just a step I need to perform in order to have the "index" column by group.
Here below the error (it is in italian, sorry for that)
and here below the advance editor text (since the step before "group by" everithing works well)
and the data structure before the error
I already tried to change the type of the columns but nothing change.
I'm depress since the same code works fine with a "smaller data set".
Thanks all who would help me.
Hi @AleUP
How did you use the Groupby function? You wrote the M code directly or used the Group By feature in User Interface?
I like to use the User Interface to do group by. According to your code, you can select All Rows in Operation box.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @v-jingzhang ,
yes I used the User Interface to do group by and selected All Rows in Operation box as you did.
I suppose there is a suspicion that there is a text value in a column which is marked as numeric. It probably only shows as a problem once more than 1000 rows are loaded.
You could experiment by simplifying the steps in the query/ making all fields text type then doing the Group by OR loading all rows in the preview and using the 'column quality'/distribution/profile features from the View menu
Thanks for your reply, i'm tring to do as you suggested, but it doesn't work: I add the step to modify all columns type to text
I don't understand wich "operation" it need to perform in this step??? Why the error reports "operator - "??
Yesterday I noticed that if I delete the step "sort columns", as per magic the group by works without any error.
However I need To perform this step to order the columns before the grouping because is important to assign the index correctly
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |