Forum Discussion
Get Table Object based on String
- 3 years ago
Hi Mikelytics ,
you could use the function Expression.Evaluate for it, but this won't work if you want to refresh the report in the PBI service.
Instead, I would recommend to append all 3 tables into 1 and create a "TableName" column to distinguish between them. Then you can use a Table.SelectRows command to filter the relevant table for each row, as this allows you to pass a text string.
Hi AntrikshSharma ,
it's been a while since I last played with #section and #shared, but to my experience they will not work once you try to load in the datamodel or in the service.
So I am very interested to hear if your query will actually load into the datamodel without causing errors nowadays.
- AntrikshSharma3 years agoCommunity Champion
ImkeF Yup, you are right it does throw an error. The only case it works for me is if I use it to get the list of Query Names.
= Record.FieldNames ( #sections[Section1] )Do you know why it generates error? Would have been good to use this freely.
- Mikelytics3 years agoResident Rockstar
Hi AntrikshSharma ,
Great Approach! BAsed on your input I did the following.
Creation of support table using your secrtion comment:
Left Join into my Parameter table based on table name:
Expansion of column and it worked so far!
Now I check whether it works in the service. so I did another expansion of the table to get the actual line-items which I can then load into the data model.
And now comes the weird Thing!
In the data model the items are not shown!
Did I do something wrong?
So I did not even come to the service since the values are not taken over into the data model in Desktop which is a really weird behavior since I could see the actual rows in Power Query. 😕
Or is there something I miss?
Best regards
Michael