Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |