{"id":1612,"date":"2020-07-31T12:30:29","date_gmt":"2020-07-31T12:30:29","guid":{"rendered":"https:\/\/bi.unija.com\/en\/?p=1612"},"modified":"2020-08-17T13:54:30","modified_gmt":"2020-08-17T13:54:30","slug":"appending-queries","status":"publish","type":"post","link":"https:\/\/bi.unija.com\/en\/appending-queries\/","title":{"rendered":"Appending Queries"},"content":{"rendered":"<p><em>For Power BI version 2.76.5678.782 (December 2019).<\/em><\/p>\n<p>Every Power BI project starts with many queries. Whenever possible, we append queries. We always work toward a <strong>star schema<\/strong>, meaning one large fact table and several smaller dimension tables. More on star schema can be found in article 5 best practices on data modeling.<\/p>\n<h1>Appending tables with the same columns<\/h1>\n<p>We usually append tables with same columns. Column order is not important, we only need to make sure names and data types match in both tables. Values from the second table will then be filled to the appropriate columns in the first table.<\/p>\n<p>Let&#8217;s look at example of two tables, named <strong>Locations1<\/strong> and <strong>Locations2<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"318\" class=\"wp-image-1654\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-45.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-45.png 446w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-45-300x214.png 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/>\u00a0 \u00a0<img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"288\" class=\"wp-image-1655\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-46.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-46.png 446w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-46-300x194.png 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/><\/p>\n<p>Appending <strong>Locations2<\/strong> to <strong>Locations1<\/strong> gives a merged table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"394\" class=\"wp-image-1656\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-47.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-47.png 450w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-47-300x263.png 300w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>To append the tables use the following steps.<\/p>\n<ol>\n<li>Select the primary table, in our case <strong>Locations1<\/strong>.<\/li>\n<li>Select <strong>Append Queries<\/strong>.<\/li>\n<li>Select the second table, in our case <strong>Locations2<\/strong>.<\/li>\n<li>Confirm with <strong>OK<\/strong>.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"889\" height=\"493\" class=\"wp-image-1657\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-48.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-48.png 889w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-48-300x166.png 300w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-48-768x426.png 768w\" sizes=\"(max-width: 889px) 100vw, 889px\" \/><\/p>\n<h1>Appending tables with different columns<\/h1>\n<p>If column names in both tables don&#8217;t match, appending results in a bigger table with as many columns as unique names in starting tables. We&#8217;ll use the same tables as in previous example. We rename the column in second table to <strong>Name2<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"318\" class=\"wp-image-1658\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-49.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-49.png 446w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-49-300x214.png 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/> <img loading=\"lazy\" decoding=\"async\" width=\"443\" height=\"285\" class=\"wp-image-1659\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-50.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-50.png 443w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-50-300x193.png 300w\" sizes=\"(max-width: 443px) 100vw, 443px\" \/><\/p>\n<p>After appending we get a table with all columns. Missing values are filled with <em>null<\/em> value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"398\" class=\"wp-image-1660\" src=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-51.png\" srcset=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-51.png 647w, https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/word-image-51-300x185.png 300w\" sizes=\"(max-width: 647px) 100vw, 647px\" \/><\/p>\n<h1>Duplicates<\/h1>\n<p>Appending doesn&#8217;t remove duplicates, for this purpose we use <strong>Remove Duplicates<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For Power BI version 2.76.5678.782 (December 2019). Every Power BI project starts with many queries. Whenever possible, we append queries. We always work toward a star schema, meaning one large fact table and several smaller dimension tables. More on star<\/p>\n","protected":false},"author":5,"featured_media":1662,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[9],"class_list":["post-1612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced","tag-power-query"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Appending Queries - Bi Unija<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bi.unija.com\/en\/appending-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Appending Queries - Bi Unija\" \/>\n<meta property=\"og:description\" content=\"For Power BI version 2.76.5678.782 (December 2019). Every Power BI project starts with many queries. Whenever possible, we append queries. We always work toward a star schema, meaning one large fact table and several smaller dimension tables. More on star\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bi.unija.com\/en\/appending-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"Bi Unija\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-31T12:30:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-17T13:54:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Branka Trifunovi\u0107\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Branka Trifunovi\u0107\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/\",\"url\":\"https:\/\/bi.unija.com\/en\/appending-queries\/\",\"name\":\"Appending Queries - Bi Unija\",\"isPartOf\":{\"@id\":\"https:\/\/bi.unija.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png\",\"datePublished\":\"2020-07-31T12:30:29+00:00\",\"dateModified\":\"2020-08-17T13:54:30+00:00\",\"author\":{\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10\"},\"breadcrumb\":{\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bi.unija.com\/en\/appending-queries\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage\",\"url\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png\",\"contentUrl\":\"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png\",\"width\":720,\"height\":480},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bi.unija.com\/en\/appending-queries\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bi.unija.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Appending Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bi.unija.com\/en\/#website\",\"url\":\"https:\/\/bi.unija.com\/en\/\",\"name\":\"Bi Unija\",\"description\":\"Just another Bi site\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bi.unija.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10\",\"name\":\"Branka Trifunovi\u0107\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bi.unija.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g\",\"caption\":\"Branka Trifunovi\u0107\"},\"url\":\"https:\/\/bi.unija.com\/en\/author\/branka\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Appending Queries - Bi Unija","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bi.unija.com\/en\/appending-queries\/","og_locale":"en_US","og_type":"article","og_title":"Appending Queries - Bi Unija","og_description":"For Power BI version 2.76.5678.782 (December 2019). Every Power BI project starts with many queries. Whenever possible, we append queries. We always work toward a star schema, meaning one large fact table and several smaller dimension tables. More on star","og_url":"https:\/\/bi.unija.com\/en\/appending-queries\/","og_site_name":"Bi Unija","article_published_time":"2020-07-31T12:30:29+00:00","article_modified_time":"2020-08-17T13:54:30+00:00","og_image":[{"width":720,"height":480,"url":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png","type":"image\/png"}],"author":"Branka Trifunovi\u0107","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Branka Trifunovi\u0107","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/bi.unija.com\/en\/appending-queries\/","url":"https:\/\/bi.unija.com\/en\/appending-queries\/","name":"Appending Queries - Bi Unija","isPartOf":{"@id":"https:\/\/bi.unija.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage"},"image":{"@id":"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage"},"thumbnailUrl":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png","datePublished":"2020-07-31T12:30:29+00:00","dateModified":"2020-08-17T13:54:30+00:00","author":{"@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10"},"breadcrumb":{"@id":"https:\/\/bi.unija.com\/en\/appending-queries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bi.unija.com\/en\/appending-queries\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bi.unija.com\/en\/appending-queries\/#primaryimage","url":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png","contentUrl":"https:\/\/bi.unija.com\/en\/wp-content\/uploads\/sites\/2\/2020\/08\/17.png","width":720,"height":480},{"@type":"BreadcrumbList","@id":"https:\/\/bi.unija.com\/en\/appending-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bi.unija.com\/en\/"},{"@type":"ListItem","position":2,"name":"Appending Queries"}]},{"@type":"WebSite","@id":"https:\/\/bi.unija.com\/en\/#website","url":"https:\/\/bi.unija.com\/en\/","name":"Bi Unija","description":"Just another Bi site","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bi.unija.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/3bed36623727c7162e421c4366a54e10","name":"Branka Trifunovi\u0107","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bi.unija.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ec99f651bcc98a163161515ec254b974?s=96&d=mm&r=g","caption":"Branka Trifunovi\u0107"},"url":"https:\/\/bi.unija.com\/en\/author\/branka\/"}]}},"_links":{"self":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1612"}],"collection":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/comments?post=1612"}],"version-history":[{"count":1,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1612\/revisions"}],"predecessor-version":[{"id":1661,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/posts\/1612\/revisions\/1661"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/media\/1662"}],"wp:attachment":[{"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/media?parent=1612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/categories?post=1612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bi.unija.com\/en\/wp-json\/wp\/v2\/tags?post=1612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}