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
adrianal
Regular Visitor

Create Union with filtered table names

Hello, 

 

I'm have the following scenario:

 

A table where i stored all the filters i need (the table names where to get the data from, which filters to apply on which columns):

adrianal_0-1626969551022.png

 

Now what i'm trying to do is to union this 2 tables from column "Origin Table" into a new table, but to get the names for the tables by filtering the table above, something like this:

 

New Table =

UNION(
         SELECTCOLUMNS(
                         Filter for the table name in the table above in column Origin Table => "Product",
                         I can deal with the filters on the columns )
        SELECTCOLUMNS(
                         Filter for the table name in the table above in column Origin Table => "Product",
                         I can deal with the filters on the columns )
        SELECTCOLUMNS(

                         Filter for the table name in the table above in column Origin Table => "Customer",
                         I can deal with the filters on the columns )
)

 

And the relsult expected is this one:

adrianal_1-1626970247689.png

 

Is there a way to get the name of a table using filter in Union? If not, can you please help me with another solution to do this?

 

Hope i made myself clear in this explanation 

Thank you!!!

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @adrianal ,

 

Can you provide me with sample data? Please be careful to hide private data.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

So you are basically creating your own query language?

 

Usually in such a case you have to help and provide the table names manually (add the table name as a static column in the SELECTCOLUMNS statement).

 

Or maybe vote for making EVALUATE() available in Power BI DAX.

 

 

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.