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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pollyannaog
Frequent Visitor

Log column that expands a strange problem :(

Hey, everybody, how are you?

I'm facing a strange problem with query transformation in Power BI Desktop. I have a dataset where "column1" is a list of data (see image below):

Sem título.png

When I expand "column1" it looks like it's a record list colum, with some null rows (see image below):

Sem título.png

Therefore, I again apply an expansion, now in this column of records. So, it looks like everything worked well (see image below):

Sem título.png

But... When I apply all transformations, Power BI displays this error:

Sem título.png

It seems that few row records that were expanded did not match the expected structure. I've tried many transformations without success and searched the web, but I can't find a solution for this. Can someone help me?

Thank you!!!

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @pollyannaog 

Can you share a mock pbix that reproduces the problem?

Looking at the error message it looks like PQ encounters a record where it expects a table. You could check if the item is a record with the following (it will yield true if it is a record):

Value.Is([YourColumnName], type record)

and then, if it is a record either ignore it in the expansion or perhaps convert it to table, depending on what you prefer.

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

 

 

View solution in original post

5 REPLIES 5
mahoneypat
Employee
Employee

I am not sure what the M code of the expansion step looks like without having similar data, but if it includes an each expression (per row transformation), you could wrap the existing each function in try <existing M> otherwise "Had An Error".  That way you could refresh and see which rows are causing the error so you can investigate further.

 

Regards,

Pat

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


v-shex-msft
Community Support
Community Support

HI @pollyannaog,

Did you dataset table structure dynamic changes? AFAIK, power query will cache the previous processing table structure into query steps.

If some records data structure or stored data type changes so that they do not match with the cached data structure, power query will return an error message about the wrong type/structure transform.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

It does make sense, I hasn't think about it...thats why the error only happens when I apply the transformations.

AlB
Super User
Super User

Hi @pollyannaog 

Can you share a mock pbix that reproduces the problem?

Looking at the error message it looks like PQ encounters a record where it expects a table. You could check if the item is a record with the following (it will yield true if it is a record):

Value.Is([YourColumnName], type record)

and then, if it is a record either ignore it in the expansion or perhaps convert it to table, depending on what you prefer.

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

 

 

Thank you @AlB , with this trick I was able to create a custom column with the type of each row and then find out the one with different type!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.