Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I'm trying to create a relationship between elements in different tables with the distinct union DAX, but it's returning a null/blank result in the new table, which then won't let me create relationships.
I've used this before and it's worked fine..
Can anyone help with this?
Thank you!
Solved! Go to Solution.
First, use DISTINCT instead of VALUES, so to avoid the blank row which might be created due to invalid relationships. Then, if BLANK is present somwhere among teh values, you can simply surround the whole code with a FILTER that removes the blank:
FILTER (
DISTINCT (
UNION (
DISTINCT ( T1[C] ),
DISTINCT ( T2[C] )
)
),
NOT ISBLANK ( [C] )
)
Have fun with DAX!
Alberto Ferrari
http://www.sqlbi.com
First, use DISTINCT instead of VALUES, so to avoid the blank row which might be created due to invalid relationships. Then, if BLANK is present somwhere among teh values, you can simply surround the whole code with a FILTER that removes the blank:
FILTER (
DISTINCT (
UNION (
DISTINCT ( T1[C] ),
DISTINCT ( T2[C] )
)
),
NOT ISBLANK ( [C] )
)
Have fun with DAX!
Alberto Ferrari
http://www.sqlbi.com
When using NOT ISBLANK for only one column wrapped inside the DISTINCT() it's clear. But when aggregating 2 columns wrapped in a UNION() I didn't understand why the engine just gives me the first table[column] as a option to wrap inside the filter function.
For example, when I use the NOT ISBLANK("I only can add the T1[C] option)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!