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
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!