cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nadavbi
Frequent Visitor

Concatenating parameter to a table name

I'm using the advanced editor to get many data tables.

One of the relevant lines in the editor looks like this (or similar)

powerbi_test_86035_meta_Table = templates_Schema{[Name="powerbi_test_86035_meta",Kind="Table"]}[Data]

I want to be able to replace the number in the middle (86035) with some kind of manual parameter, so when I change the parameter once, all the tables will update accordingly.

Is there a way to do this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@nadavbi , create a parameter as TEXT, I've called it Parameter1 in this example.

 

Add this M code to your query:

 

PowerBI_Name_FromParameter = "powerbi_test_" & Parameter1 & "_meta",
Table_FromParameter =  templates_Schema{[Name=PowerBI_Name_FromParameter,Kind="Table"]}[Data]

The first step simply concatenates the name using the Parameter1 value

The second step passes the concatenated name in to return the proper table.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@nadavbi , create a parameter as TEXT, I've called it Parameter1 in this example.

 

Add this M code to your query:

 

PowerBI_Name_FromParameter = "powerbi_test_" & Parameter1 & "_meta",
Table_FromParameter =  templates_Schema{[Name=PowerBI_Name_FromParameter,Kind="Table"]}[Data]

The first step simply concatenates the name using the Parameter1 value

The second step passes the concatenated name in to return the proper table.

Did not work for me.  Using Power BI Desktop optimized for Report Server (on-premise) January 2020 Release.

 

Thanks and regards,

Jitendra Pandey

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors