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

Stack overflow after expanding

Hi guys,

 

I'm running into a stack overflow error after expanding a #shared table. I've done this:

 

1. I created three excel files with two columns each: name and value. These excel files contain the same names but have different values (imagine these files to be sales data for specific products). They each hold three rows.

 

2. I've loaded each of them into Power BI Desktop. This is the M code for them (only the first one shown):

 

let
    Source = Excel.Workbook(File.Contents("C:\Temp\Book1.xlsx"), null, true),
    ProductA_Sheet = Source{[Item="ProductA",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(ProductA_Sheet),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Name", type text}, {"Value", Int64.Type}})
in
    #"Changed Type"

 

 

3. I created a query using #shared like this:

 

let
    Query1 = #shared,
    #"Converted to Table" = Record.ToTable(Query1),
    #"Kept First Rows" = Table.FirstN(#"Converted to Table",3),
    #"Expanded Value" = Table.ExpandTableColumn(#"Kept First Rows", "Value", {"Name", "Value"}, {"Name.1", "Value.1"})
in
    #"Expanded Value"

As soon as I try to close and save the query editor I get a stack overflow error. I've tried this on both 32 and 64 bit versions of PBI Desktop as well as the January and December versions as well. Same error. Everything works fine until I do the expand operation and try to save. I found a weird behaviour that might or might not be related; this is what I see in the "edit query" before keeping the first three rows:

before_kept_rows.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And after keeping the three rows:


after_kept_rows.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

But this is what I see out in the PBI Desktop:

 

funny.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This may or may not be just a bug in the display, or it might be the actual culprit. Can anyone lend me a hand?

 

 

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @aarvidsson,

 

I can reproduce the issue on my side, and reported it internally. Will keep you updated once get any feedback.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-haibl-msft
Employee
Employee

@aarvidsson

 

Below is the response from product team:

This is effectively working as designed. Scenarios using #shared are for advanced users who understand its limitations.

 

Best Regards,

Herbert

How many items do you have in the sheets? I tried to reproduce the issue. I created three product spreadsheets with just name and value columns.  Here was the shared query. (I'm using the January Power BI Desktop.

 

let
Query = #shared,
Converted = Record.ToTable(Query),
KeptRows = Table.FirstN(Converted ,3),
ExpandedItems = Table.ExpandTableColumn(KeptRows, "Value", {"Name", "Value"}, {"Name.1", "Value.1"})
in
ExpandedItems

 

SharedResult.png

Adam W. Saxton | Microsoft Employee | Business Intelligence
@GuyInACube | youtube.com/guyinacube

Hi Adam,

 

The problem won't show itself until you close and apply back to PBI desktop. Then the resulting query will be blank. This is probably due to some scoping issue with #shared and #section (and equally probably by design), but I can't get my head around how it's supposed to work. In your case, using FirstN, I'm fairly sure you'll hit the original but as well (stack overflow), but try a range or a last N and you'll see the problem with the blank query...

v-qiuyu-msft
Community Support
Community Support

Hi @aarvidsson,

 

I can reproduce the issue on my side, and reported it internally. Will keep you updated once get any feedback.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sounds excellent, @v-qiuyu-msft 🙂 I think it might actually be another bug lurking here as well; if I use table.range or any other filtering method that does not result in the stack overflow and go back to PBI Desktop, I see no data in queries despite everything looking normal in the query editor...?

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.