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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Cybe
New Member

Columns from multiple sources into a single column of distinct values

Hello,

 

  I have dissimilar data sources with one column of like values, and I'm unsure how to join them;  I may be asking the wrong question in my searches for 'combine', 'summarize', etc.  

 

Source 1

DeviceFirewall StatusIrrelevant Data
COMPUTER1OffApple
COMPUTER2OnOrange
COMPUTER3OnLemon

 

Source 2

Computer NameAntivirus Status
COMPUTER1True
COMPUTER4False

 

Source 3

HostnameInternet FacingOther Data
COMPUTER2Fullynull
COMPUTER3PartiallyYes
COMPUTER5Partiallynull

 

Desired Output (A matrix table)

AllComputersInternet FacingFirewallAntivirus
COMPUTER1nullOffTrue
COMPUTER2FullyOnnull
COMPUTER3PartiallyOnnull
COMPUTER4nullnullFalse
COMPUTER5Partiallynullnull

 

I've tried to achieve this via Merge as New, OUTER JOIN in Transform Data, but the result is multiple 'Computername' type columns.   My situation is similar like the post below - but adapting the UNION solution returns, 'a table of multiple values was supplied where a single value was expected'

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Repeating-quot-Key-quot-column-value-in-Calcu...

 

What am I missing?  Any help appreciated!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Cybe 

you can do this in pq.

pls see the attachment below

1.PNG

you can also use DAX to create a table

 

Table = 
VAR tbl=DISTINCT(UNION(SELECTCOLUMNS('Source 1',"AllComputers",'Source 1'[Device]),SELECTCOLUMNS('Source 2',"Allcomputers",'Source 2'[Computer Name]),SELECTCOLUMNS('Source 3',"Allcomputers",'Source 3'[Hostname])))
return ADDCOLUMNS(tbl,"Internet Facing",maxx(FILTER('Source 3',[AllComputers]='Source 3'[Hostname]),'Source 3'[Internet Facing]),"firewall",maxx(FILTER('Source 1',[AllComputers]='Source 1'[Device]),'Source 1'[Firewall Status]),"Antivirus",maxx(FILTER('Source 2',[AllComputers]='Source 2'[Computer Name]),'Source 2'[Antivirus Status]))

 

2.PNG





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Cybe
New Member

Thank you @ryan_mayu, your attachment contained the answer I needed; 
For future searchers, I created a New Source / Blank Query, and input:

 

= Table.FromList( List.Distinct(List.Combine({#"Source 1"[Device],#"Source 2"[Computer Name],#"Source 3"[Hostname]})))

 

This produced a single column of all computers from the three sources. 

Then, merge in each of the original sources (left join on computer name) to produce the desired output.


Thank you @ryan_mayu!  

you are welcome





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

Proud to be a Super User!




ryan_mayu
Super User
Super User

@Cybe 

you can do this in pq.

pls see the attachment below

1.PNG

you can also use DAX to create a table

 

Table = 
VAR tbl=DISTINCT(UNION(SELECTCOLUMNS('Source 1',"AllComputers",'Source 1'[Device]),SELECTCOLUMNS('Source 2',"Allcomputers",'Source 2'[Computer Name]),SELECTCOLUMNS('Source 3',"Allcomputers",'Source 3'[Hostname])))
return ADDCOLUMNS(tbl,"Internet Facing",maxx(FILTER('Source 3',[AllComputers]='Source 3'[Hostname]),'Source 3'[Internet Facing]),"firewall",maxx(FILTER('Source 1',[AllComputers]='Source 1'[Device]),'Source 1'[Firewall Status]),"Antivirus",maxx(FILTER('Source 2',[AllComputers]='Source 2'[Computer Name]),'Source 2'[Antivirus Status]))

 

2.PNG





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

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.