Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have a calculated table that is aggregating the (distinct) Name column from other tables. How do I tweak the formula to get other columns from those tables as well (such as Address, Location of the "Name", etc)?
Thanks a lot for any help!
New table=
DISTINCT (
UNION (
VALUES ( 'Table1'[Name] ),
VALUES ( 'Table2'[Name] ),
VALUES ( 'Table3'[Name] ),
VALUES ( 'Table4'[Name] ),
VALUES ( 'Table5'[Name] ),
VALUES ( 'Table6'[Name] ),
VALUES ( 'Table7'[Name] )
)
)
Solved! Go to Solution.
Hi @Chris2016,
If Address and Location are columns which are present in all the tables (Table1 ... Table7), you could transform your [DAX] query into something like this:
New table=
DISTINCT (
UNION (
SELECTCOLUMNS ( Table1, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table2, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table3, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table4, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table5, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table6, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table7, "Name, "[Name], "Address", [Address], "Location", [Location] )
)
)
Best Regards,
Alexander
Hi @Chris2016,
If Address and Location are columns which are present in all the tables (Table1 ... Table7), you could transform your [DAX] query into something like this:
New table=
DISTINCT (
UNION (
SELECTCOLUMNS ( Table1, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table2, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table3, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table4, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table5, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table6, "Name, "[Name], "Address", [Address], "Location", [Location] ),
SELECTCOLUMNS ( Table7, "Name, "[Name], "Address", [Address], "Location", [Location] )
)
)
Best Regards,
Alexander
Yes, the other columns are in the same tables. Thanks a lot for the help, that works!
Best regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |