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

Get first non-null value from two tables with relationship for a filter

I have two tables with a many to one relationship:

 

Table1

Col1
1
2

3

 

 

Table2

Col1
1

1

1

5

5

4

 

I want to create a column that I can filter on that will show values:

1

2

3

4

5

 

I tried creating a column:

Col3 = IF( ISBLANK('Table1'Col1), MAX('Table2'Col1),'Table1'Col1)

 

But htat doesn't seem to be working.

Any help appreciated 🙂 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Anonymous,

You can create a new table using Dax below.

newtable = 
FILTER(
DISTINCT(
UNION(
DISTINCT(Table1[Col1]),
DISTINCT(Table2[Col1])
)
),
NOT(ISBLANK(Table1[Col1]))
)
)

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@Anonymous,

You can create a new table using Dax below.

newtable = 
FILTER(
DISTINCT(
UNION(
DISTINCT(Table1[Col1]),
DISTINCT(Table2[Col1])
)
),
NOT(ISBLANK(Table1[Col1]))
)
)

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @Anonymous,

 

Not sure what you want to do but if you want to create a new table only with unique values the best way to do it is on the query editor.

 

You should append both tables, delete all the columns you don't need and then Remove duplicates.

 

Regards.

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.