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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
shahid_tanmoy
Helper I
Helper I

How do I append two sources in DAX code instead of the append button?

Hi All, 

I have two JSON sources. 
Normally I would have to create two seperate JSON sources and append the 2nd to the first. 
Can someone write me out the code to do it all in one? 

Thanks! 

 

 

Here is the first code, the 2nd code looks exactly the same just comes from a different system 

let
Source = Json.Document(Web.Contents(" URL IS HERE ")), 

(IS IT POSSIBLE TO JOIN THEM HERE, LIKE URL 1+ URL 2) 
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded data" = Table.ExpandListColumn(#"Converted to Table", "data"),
#"Expanded data1" = Table.ExpandRecordColumn(#"Expanded data", "data", {"account_name"}, {"data.account_name"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded data1",{{"data.account_name", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"data.account_name", "account_name"}})
in
#"Renamed Columns"

 

(OR IF THE FIRST ISINT POSSIBLE, THIS IS USUALLY WHERE THE APPEND SYNTAX IS THAT REFERS TO A DIFFERENT QUERY TABLE, IS IT POSSIBLE TO JUST UNION THE 2ND QUERY HERE) 

2 REPLIES 2
ppm1
Solution Sage
Solution Sage

You should be able to start with a table with two rows for your two URL values. Then add a custom column with your Json.Document expression where you concatenate in the URL for that row. You should then get a Table in each row you can expand to get your desired final table.

 

Pat

Microsoft Employee
lbendlin
Super User
Super User

You are mixing concepts.  The process is different in Power Query and in DAX.

 

Power Query:

Let's assume you have flattened your JSON into tables QueryA and QueryB.  Then indeed you can write

 

= QueryA & QueryB

 

to append them.

 

In DAX you would need to use UNION

 

UNION (QueryA,QueryB)

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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