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
Anonymous
Not applicable

Filters do not apply on UNION Tables

Hi guys,

 

I'm trying to join two tables with the same columns. I want to use the new table to show the datas from the two initial tables but i want to apply a filter on one of the column of one of the two tables.

 

My problem is that the UNION table is not affected by the filter on the initial table.

 

Can I solve that ?

1 ACCEPTED SOLUTION
Smauro
Solution Sage
Solution Sage

Hey @Anonymous,

 

I'm not completely sure what you're trying to do, but I'm rifht and you have everything else down and still want to differentiate after the UNION, it's easy:
Create a column in both before the UNION, with the same name, and just fill that column with tablename or 1 & 0 or anything that after the union will have two values. (Like [TableName] = "xyz" in the first, and [TableName] = "abc" in the second)

Afterwards, when filtering, you could just always apply an extra clause with the [TableName] value.

🙂




Feel free to connect with me:
LinkedIn

View solution in original post

4 REPLIES 4
Smauro
Solution Sage
Solution Sage

Hey @Anonymous,

 

I'm not completely sure what you're trying to do, but I'm rifht and you have everything else down and still want to differentiate after the UNION, it's easy:
Create a column in both before the UNION, with the same name, and just fill that column with tablename or 1 & 0 or anything that after the union will have two values. (Like [TableName] = "xyz" in the first, and [TableName] = "abc" in the second)

Afterwards, when filtering, you could just always apply an extra clause with the [TableName] value.

🙂




Feel free to connect with me:
LinkedIn

Anonymous
Not applicable

I'll try to be more clear 🙂

 

My UNION is made on two tables, both contains text news :

 

  • One contains national news, with the "national" value on one of its column,
  • the other one contains local news, with the city name value on one of its column.

 

The result of the UNION is one table. On one column there is either the "National" value, either a city name.

 

On my report i have a filter that filters the local news table with the city name so I wanted the UNION table to display the national news and the local news based on the city name selected on my filter, but the filter doesnt seem to filter the result table even if it's filtering the source table...

Anonymous
Not applicable

Hi,

 

Did you ever get a solution to this please?

 

I'm trying to do exactly the same thing you describe and I'm facing the same issue.

 

Thanks.

OwenAuger
Super User
Super User

Hi @Anonymous

Do you mean you created a calculated table using the UNION function?

Once a calculated table is created, it has no lineage to any existing tables in the model, and you would need to create a relationship with the table where you are appling filters for those filters to have any effect.

 

If the UNION function is being used as part of a measure however, lineage is retained where possible for each column separately, so filters could still have effect during the evaluation of the measure.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

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.