The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
My underlying query from Advance query editor is
let
Source = VSTS.Views("ABC", "PQR", null, []),
#"Work Items - Today1" = Source{[Name="Work Items - Today"]}[Data]
in
#"Work Items - Today1"
I want to add one more set here, account name is same ABC but vsts project name is XYZ can we do like this so that I can merge two data set. I do not want to create seperate table and then merge because in VSTS I have many projects and I do not want to create table for each project and then merge
let
Source = VSTS.Views("ABC", "PQR", null, []),
#"Work Items - Today1" = Source{[Name="Work Items - Today"]}[Data]
&
Source = VSTS.Views("ABC", "XYZ", null, []),
#"Work Items - Today2" = Source{[Name="Work Items - Today"]}[Data]
in
#"Work Items - Today1" & #"Work Items - Today2"
Please suggest
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsYes, I can use merge or append to one dataset by creating seperate datasets for each project, I have many projects in VSTS so I need to create that number of tables and then merge, I was thinking to merge without creating any seperate data set
Hi @mahesh_marathe,
You don't need to create those tables you only create one single table that as several sources (VSTS) you can do this in 3 ways:
1 - If it's an SQL do the append/merge of the tables in SQL and only return the outcome to Power BI
2 - Do a single query in PBI that as several sources and returns the final result
3 - Do a function in PBI (getting the information and treatment for 1 of the VSTS) and then do a list with the names of the full VSTS and run the function against tha list, this implies that the names of your VSTS must be somehow similar or you have them in a list. (check this site for a more detailed and example how this works - https://www.mattmasson.com/2014/11/iterating-over-multiple-pages-of-web-data-using-power-query/)
OPTION 2: let Source = Excel.Workbook(File.Contents("C:\Desktop\VSTS_Datasource.xlsx"), null, true), VSTS1_Table = Source{[Item="VSTS1",Kind="Table"]}[Data], VSTS2_Table = Source{[Item="VSTS2",Kind="Table"]}[Data], VSTS3_Table = Source{[Item="VSTS3",Kind="Table"]}[Data], VSTS4_Table = Source{[Item="VSTS4",Kind="Table"]}[Data], VSTS5_Table = Source{[Item="VSTS5",Kind="Table"]}[Data], VSTS6_Table = Source{[Item="VSTS6",Kind="Table"]}[Data], VSTS7_Table = Source{[Item="VSTS7",Kind="Table"]}[Data], VSTS8_Table = Source{[Item="VSTS8",Kind="Table"]}[Data], Append_Data = Table.Combine({VSTS1_Table, VSTS2_Table, VSTS3_Table, VSTS4_Table, VSTS5_Table, VSTS6_Table, VSTS7_Table, VSTS8_Table}), Format = Table.TransformColumnTypes(Append_Data,{{"Account", type text}, {"Project", type text}}) in Format
OPTION 3 Function: (VSTS_Source) => let Source = Excel.Workbook(File.Contents("C:\Desktop\VSTS_Datasource.xlsx"), null, true), VSTS1_Table = Source{[Item="VSTS"&Number.ToText(VSTS_Source),Kind="Table"]}[Data], Format = Table.TransformColumnTypes(VSTS1_Table,{{"Account", type text}, {"Project", type text}}) in Format Data Treatment: let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [VSTS_Source_ID = _t]), Format = Table.TransformColumnTypes(Source,{{"VSTS_Source_ID", Int64.Type}}), VSTS_File_Link = Table.AddColumn(Format, "VSTS_Files", each VSTS_DataSource([VSTS_Source_ID])), Show_VSTS_Data = Table.ExpandTableColumn(VSTS_File_Link, "VSTS_Files", {"Account", "Project"}, {"VSTS_Files.Account", "VSTS_Files.Project"}) in Show_VSTS_Data
In file below see a PBI file and EXCEL base just change the path for the both option in the row SOURCE to where you save the excel file and everything should be working.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsJoin the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
50 | |
21 | |
12 | |
11 | |
11 |
User | Count |
---|---|
117 | |
30 | |
29 | |
21 | |
20 |