cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nadavbi Frequent Visitor
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

Accepted Solutions
ChrisHaas Established Member
Established Member

Re: Concatenating parameter to a table name

@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

1 REPLY 1
ChrisHaas Established Member
Established Member

Re: Concatenating parameter to a table name

@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

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors