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
Hi, I noticed that when we use Python Transformation, then Power Query is aware of the row we are. If we do, for example, dataset[newcolumn] = dataset[somecolumn] it will give the corresponding row value to the new column. Problem is, when we do something like str(dataset[somecolumn]), Power Query loses his awarenesess of which row it is at, instead it'll probably raise an error, or if we do something to aggregate those values it will give the entire dataframe for each row.
Question is: how can I get Power Query to know which row it is again after do some kind of conversion?
Hi @fdanielsouza ,
I am not very sure what you want to do. Do you want to convert rows into columns?
If so, how about using UnPivot or Transpose?
If not, could you share us more details?
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fdanielsouza ,
not sure what's actually going on in what you're describing.
But the "problem" with Power Query is that it uses some syntax sugar when working with functions.
Therefore, using square brackets can mean that you're referencing either a column from a table or a field from a record. The later would be "row aware".
So to understand what's (not) going on in your case, I would have to understand the context in which the expressions where used.
For more, see this link: Understanding Power Query M functions - PowerQuery M | Microsoft Docs
and for the lookup operators: Operators - PowerQuery M | Microsoft Docs
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!