Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Daniel48
Helper I
Helper I

Union three columns across three tables

Hello, 

 

Is it possible to create a column that only has distinct values from 3 columns on 3 different tables. I found the formula below but it keeps giving me errors.

 


Thank you in advance!

 

 

Country = FILTER(
    DISTINCT(UNION(VALUES('4 - Data (CSAT)'[Country]), VALUES('4 - Data (Voice)'[Country]))),
    [Country] <> BLANK()
)

 

 

1 ACCEPTED SOLUTION

try this

 

Master Policy Table =
FILTER (
    DISTINCT (
        UNION (
            VALUES ( 'policy finance_Initial'[policy_uniqueid] ),
            VALUES ( 'policy finance_target'[policy_uniqueid] ),
            VALUES ( 'policy premium'[policy_uniqueid] )
        )
    ),
    [policy_uniqueid] <> BLANK ()
)

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Before you can do a UNION your columns need to have the same name.  Use SELECTCOLUMNS  to rename them as needed.

Master Policy Table = FILTER(DISTINCT(UNION(VALUES('policy finance_Initial'[policy_uniqueid]),VALUES('policy finance_target'[policy_uniqueid]),VALUES('policy premium'[policy_uniqueid])),
    [policy_uniqueid] <> BLANK()))
 
I have renamed the columns but I am getting the error. Too many arguments were passed to the DISTINCT function. The maximum argument count for the function is 1. I can get it with two columns but not three

try this

 

Master Policy Table =
FILTER (
    DISTINCT (
        UNION (
            VALUES ( 'policy finance_Initial'[policy_uniqueid] ),
            VALUES ( 'policy finance_target'[policy_uniqueid] ),
            VALUES ( 'policy premium'[policy_uniqueid] )
        )
    ),
    [policy_uniqueid] <> BLANK ()
)

That worked perfectly! Thank you for all of your help!

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors