cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shahid_tanmoy
Helper I
Helper I

How do I append two sources in DAX code?

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) 

1 REPLY 1
amitchandak
Super User
Super User

@shahid_tanmoy , Convert both of them to table and append.

 

You can do that in same query if needed

 

if needed refer

Merge Queries, Why not Merge the code: https://youtu.be/YOFs39RCPfQ



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors