{"id":2719,"date":"2023-12-29T23:03:24","date_gmt":"2023-12-29T22:03:24","guid":{"rendered":"https:\/\/newdatalabs.com\/en\/?p=2719"},"modified":"2023-12-29T23:05:34","modified_gmt":"2023-12-29T22:05:34","slug":"modelling-data-in-power-bi-using-power-query","status":"publish","type":"post","link":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/","title":{"rendered":"Modelling Data in Power BI using Power Query"},"content":{"rendered":"\n<p>Data visualization is one of the stages of analysis, but usually one of the final steps \u2013 on its basis we can assess the condition of our business, draw conclusions or propose recommendations. However, before we reach this stage, first we need to prepare and model the data. The old analytical saying states that each analyst spends 80% of their time on preparing the data, and 20% on the analysis. For this reason, all leading Business Intelligence tools offer some form of the\u00a0<a href=\"https:\/\/newdatalabs.com\/en\/etl\/\"><strong>ETL<\/strong><\/a>\u00a0(Extract, Transform, Load). For Tableau it\u2019s Prep, and for Power BI \u2013 Power Query. The market of ETL tools is quite wide, and it offers a lot of basic and advanced programs. However, for the majority of basic business applications, the ETL add-ons would be sufficient. This way we can easily connect to the source, model the data and load the prepared model to <a href=\"https:\/\/newdatalabs.com\/en\/power-bi\/\"><strong>Power BI<\/strong><\/a>\u00a0(or Tableau) and carry out proper analysis. How to start modelling data with the help of Power Query?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting and loading data using Power Query<\/h2>\n\n\n\n<p><br>The first step is to connect the data.\u00a0<strong><a href=\"https:\/\/newdatalabs.com\/en\/power-query\/\">Power Query<\/a><\/strong>\u00a0can be initiated from the level of Power BI \u2013 by clicking the \u201cTransform data\u201d field. The data can be connected by selecting \u201cGet data\u201d. There are many connections available, from the basic cvs or xls to the online Azure or Salesforce.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"586\" height=\"644\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/1.jpg\" alt=\"\" class=\"wp-image-2720 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/1.jpg 586w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/1-273x300.jpg 273w\" data-sizes=\"(max-width: 586px) 100vw, 586px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 586px; --smush-placeholder-aspect-ratio: 586\/644;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><br>For training purposes, we will connect to the data with the results of football matches. After selecting the option File -> Text\/CSV, we are able to view our data: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"847\" height=\"625\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/2.jpg\" alt=\"\" class=\"wp-image-2721 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/2.jpg 847w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/2-300x221.jpg 300w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/2-768x567.jpg 768w\" data-sizes=\"(max-width: 847px) 100vw, 847px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 847px; --smush-placeholder-aspect-ratio: 847\/625;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>We click OK to load our data and start modelling and transforming the data. The main window of Power Query is similar to other Microsoft applications. On the top there is a ribbon with the available options, in the middle the main view of the table and on the left, there is a list search results (data connections), while on the right we have a list of actions performed during modelling. It\u2019s a very practical functionality which enables us to see the transformations which are performed on our data and int what order. In addition, once we define the steps, there is no need to define them again \u2013 when creating the transformation, we have to do that only one time. The list and steps can be edited, which simplifies adding modifications at a later stage. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"808\" height=\"265\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/3.jpg\" alt=\"\" class=\"wp-image-2722 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/3.jpg 808w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/3-300x98.jpg 300w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/3-768x252.jpg 768w\" data-sizes=\"(max-width: 808px) 100vw, 808px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 808px; --smush-placeholder-aspect-ratio: 808\/265;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cleaning, modelling and transforming data in Power Query<\/h2>\n\n\n\n<p><br><br>Once the data is loaded, we can start the tedious process of data cleaning to prepare it for analysis. When the data is connected, Power Query will automatically create three steps:<\/p>\n\n\n\n<p><br>1. Source \u2013 connecting the data<br>2. Promoted Headers \u2013 treating the first row of the table as headers<\/p>\n\n\n\n<p>3. Changed Type \u2013 determining the type of data<br>The third point is performed automatically based on the data sample; therefore, it is not always right. In our case, the model has wrongly identified the date. Text was chosen instead of Date. We can easily change it by clicking the type of data in the header:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"745\" height=\"363\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/4.jpg\" alt=\"\" class=\"wp-image-2723 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/4.jpg 745w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/4-300x146.jpg 300w\" data-sizes=\"(max-width: 745px) 100vw, 745px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 745px; --smush-placeholder-aspect-ratio: 745\/363;\" \/><\/figure>\n\n\n\n<p>The next stage is to select the relevant columns. A good practice is to leave only the ones which are needed for further analysis. This way our model will not only transparent, but it will also take less space and be quicker. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"378\" height=\"363\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/5.jpg\" alt=\"\" class=\"wp-image-2724 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/5.jpg 378w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/5-300x288.jpg 300w\" data-sizes=\"(max-width: 378px) 100vw, 378px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 378px; --smush-placeholder-aspect-ratio: 378\/363;\" \/><\/figure>\n\n\n\n<p><br><\/p>\n\n\n\n<p>Once columns are selected, we move on to rows. If our data contains errors, empty values or duplicates \u2013 we can eliminate them at this stage by choosing appropriate options. In our case, we are going to delete the rows with incorrect data. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"261\" height=\"246\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/6.jpg\" alt=\"\" class=\"wp-image-2725 lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 261px; --smush-placeholder-aspect-ratio: 261\/246;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><br><br>It\u2019s worthwhile to pay attention to the way, in which Power Query executes our commands. By selecting appropriate options from the graphic interface \u2013 the commands on the ribbon \u2013 Power Query creates formulas in the M language. We can view them in the formula tab similarly to Excel: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"552\" height=\"54\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/7.jpg\" alt=\"\" class=\"wp-image-2726 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/7.jpg 552w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/7-300x29.jpg 300w\" data-sizes=\"(max-width: 552px) 100vw, 552px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 552px; --smush-placeholder-aspect-ratio: 552\/54;\" \/><\/figure>\n\n\n\n<p><br>Other options in the ribbon allow us to split or format the columns and to extract the required values. Let\u2019s assume that we want to extract the year from the data. We can do that using the split option: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"696\" height=\"324\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/8.jpg\" alt=\"\" class=\"wp-image-2727 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/8.jpg 696w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/8-300x140.jpg 300w\" data-sizes=\"(max-width: 696px) 100vw, 696px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 696px; --smush-placeholder-aspect-ratio: 696\/324;\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"694\" height=\"203\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/9.jpg\" alt=\"\" class=\"wp-image-2728 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/9.jpg 694w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/9-300x88.jpg 300w\" data-sizes=\"(max-width: 694px) 100vw, 694px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 694px; --smush-placeholder-aspect-ratio: 694\/203;\" \/><\/figure>\n\n\n\n<p><br>Or the Extract command:<br><br>The advantage of the second option is that the new column replaces the old one. In the case of the Split command, we receive two columns, which means that we need to add another step to delete the first column. It\u2019s often the case when modelling the data in Power Query \u2013 the desired effect can be achieved in a number of ways. We should always aim for the easiest one to ensure the effectiveness of our model.<\/p>\n\n\n\n<p>Data modelling \u2013 expanding the data model by adding new elements<br><br><br><\/p>\n\n\n\n<p>With the help of Power Query, we can add new calculation columns to our data table \u2013 by using the Add Column ribbon. We can choose from several options, and the formulas can be entered in the editor available after selecting the Custom Column option. In the analyzed case, we are going to add a column with the number of goals in the match, which consists of the sum of goals scored by the home team and the away team: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"681\" height=\"416\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/10.jpg\" alt=\"\" class=\"wp-image-2729 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/10.jpg 681w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/10-300x183.jpg 300w\" data-sizes=\"(max-width: 681px) 100vw, 681px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 681px; --smush-placeholder-aspect-ratio: 681\/416;\" \/><\/figure>\n\n\n\n<p><br>The formulas are defined in the aforementioned M language. It\u2019s pretty intuitive in basic applications, but it requires some experience for more advanced ones. Therefore, the Conditional Column editor is extremely helpful \u2013 it allows us to arrange the rules according to function, as it is in Excel. Let\u2019s assume that we want to add a column which shows who won the match: the home team, the away team or a draw. The function defined in the editor looks as follows: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"916\" height=\"409\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/11.jpg\" alt=\"\" class=\"wp-image-2730 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/11.jpg 916w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/11-300x134.jpg 300w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/11-768x343.jpg 768w\" data-sizes=\"(max-width: 916px) 100vw, 916px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 916px; --smush-placeholder-aspect-ratio: 916\/409;\" \/><\/figure>\n\n\n\n<p><br>Whereas the function in the M language generated by the editor looks as shown below. If you are an experienced user of logical functions, for example in Excel, you will easily read the syntax of the function. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"38\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/12-1024x38.jpg\" alt=\"\" class=\"wp-image-2731 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/12-1024x38.jpg 1024w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/12-300x11.jpg 300w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/12-768x29.jpg 768w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/12.jpg 1284w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/38;\" \/><\/figure>\n\n\n\n<p>Our table can be further expanded by adding other columns to it. Search results can be combined either by:<br><br>1. Append \u2013 we add tables in the same layout one under the other<\/p>\n\n\n\n<p>2. Merge \u2013 we add the data from the other table to the main table, which is searched by the defined key.<\/p>\n\n\n\n<p><br>The merge option works similarly as in the case of combining tables with the join function. When selecting the Merge option, you need to indicate the table that you want to add, the fields, in which the items will be search and the type of joint (left, right, full, inner). In the analyzed example, we want to add the information about the region where the matches took place to the main table. We search the &#8220;country\u201d field using the Left Outer join. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"697\" height=\"620\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/13.jpg\" alt=\"\" class=\"wp-image-2732 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/13.jpg 697w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/13-300x267.jpg 300w\" data-sizes=\"(max-width: 697px) 100vw, 697px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 697px; --smush-placeholder-aspect-ratio: 697\/620;\" \/><\/figure>\n\n\n\n<p><br>Once the tables are joined, all we need to do is to select the fields we want to display from the connected table in our base table: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"392\" height=\"318\" data-src=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/14.jpg\" alt=\"\" class=\"wp-image-2733 lazyload\" data-srcset=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/14.jpg 392w, https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/14-300x243.jpg 300w\" data-sizes=\"(max-width: 392px) 100vw, 392px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 392px; --smush-placeholder-aspect-ratio: 392\/318;\" \/><\/figure>\n\n\n\n<p><br><br>Next, we can load the data to the model to start the data analysis and visualization process in Power BI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Power Query is a very practical and user-friendly ETL<\/h3>\n\n\n\n<p><br><br>Power Query is an excellent ETL tool. The interface is user-friendly, and it\u2019s intuitive for users who have worked with Microsoft products. The graphic editor allows us to model the data without knowing the M language or any SQL language. Therefore, we can easily perform basic transformations. A great option is the window with the applied steps during the data modelling stage, which allows us to see what\u2019s happening with the data at each stage. This way we can easily track down the path and edit it when business needs change. The data processed in Power Query is immediately available for visualization in the integrated Power BI, which all together gives us a coherent self-service BI package.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Data modelling \u2013 Tableau Prep or Power Query?<\/h3>\n\n\n\n<p><br><br>The question is similar to whether to choose Power BI or Tableau. The answer isn\u2019t straightforward as a lot depends on the user\u2019s preferences. In terms of functionality, the tools are remarkably similar \u2013 both are ETL tools that support data modelling and transforming. Both prepare the data for further analysis and visualization in Power BI or Tableau. The advantage of Tableau Prep is that it generates ready extracts to be analyzed in Tableau. We don\u2019t need to export the data to cvs files. Power Query \u2013 as it is integrated with Power BI, doesn\u2019t require to run a separate application (as Prep), which also makes our work easier. Power Query interface will also be easier to learn for beginners, as it\u2019s similar to other applications such as Excel. On the other hand, Tableau Prep is excellent at visualizing data flows, allowing us to see how the data is modelled. Therefore, it\u2019s hard to clearly indicate which of them is definitely better \u2013 they both are good ETL tools.<\/p>\n\n\n\n<p><br>Mateusz Karmalski,<br>Tableau Author<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data visualization is one of the stages of analysis, but usually one of the final steps \u2013 on its basis we can assess the condition of our business, draw conclusions or propose recommendations. However, before we reach this stage, first we need to prepare and model the data. The old analytical saying states that each [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2734,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"content-sidebar","footnotes":""},"categories":[9,7],"tags":[],"class_list":{"0":"post-2719","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-blog","8":"category-power-bi","9":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Modelling Data in Power BI using Power Query - NewDataLabs<\/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:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modelling Data in Power BI using Power Query - NewDataLabs\" \/>\n<meta property=\"og:description\" content=\"Data visualization is one of the stages of analysis, but usually one of the final steps \u2013 on its basis we can assess the condition of our business, draw conclusions or propose recommendations. However, before we reach this stage, first we need to prepare and model the data. The old analytical saying states that each [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\" \/>\n<meta property=\"og:site_name\" content=\"NewDataLabs\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-29T22:03:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-29T22:05:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"360\" \/>\n\t<meta property=\"og:image:height\" content=\"216\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Barbara\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Barbara\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\"},\"author\":{\"name\":\"Barbara\",\"@id\":\"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29\"},\"headline\":\"Modelling Data in Power BI using Power Query\",\"datePublished\":\"2023-12-29T22:03:24+00:00\",\"dateModified\":\"2023-12-29T22:05:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\"},\"wordCount\":1457,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg\",\"articleSection\":[\"Blog\",\"Power-BI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\",\"url\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\",\"name\":\"Modelling Data in Power BI using Power Query - NewDataLabs\",\"isPartOf\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg\",\"datePublished\":\"2023-12-29T22:03:24+00:00\",\"dateModified\":\"2023-12-29T22:05:34+00:00\",\"author\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29\"},\"breadcrumb\":{\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage\",\"url\":\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg\",\"contentUrl\":\"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg\",\"width\":360,\"height\":216},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/newdatalabs.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Modelling Data in Power BI using Power Query\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/newdatalabs.com\/en\/#website\",\"url\":\"https:\/\/newdatalabs.com\/en\/\",\"name\":\"NewDataLabs\",\"description\":\"Tableau - Business Intelligence Tools\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/newdatalabs.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29\",\"name\":\"Barbara\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8805976098f215eb8413b85141c17705f7ac9d91ccc0f83881d7eae1eab8c7f1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8805976098f215eb8413b85141c17705f7ac9d91ccc0f83881d7eae1eab8c7f1?s=96&d=mm&r=g\",\"caption\":\"Barbara\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Modelling Data in Power BI using Power Query - NewDataLabs","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:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/","og_locale":"en_US","og_type":"article","og_title":"Modelling Data in Power BI using Power Query - NewDataLabs","og_description":"Data visualization is one of the stages of analysis, but usually one of the final steps \u2013 on its basis we can assess the condition of our business, draw conclusions or propose recommendations. However, before we reach this stage, first we need to prepare and model the data. The old analytical saying states that each [&hellip;]","og_url":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/","og_site_name":"NewDataLabs","article_published_time":"2023-12-29T22:03:24+00:00","article_modified_time":"2023-12-29T22:05:34+00:00","og_image":[{"width":360,"height":216,"url":"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg","type":"image\/jpeg"}],"author":"Barbara","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Barbara","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#article","isPartOf":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/"},"author":{"name":"Barbara","@id":"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29"},"headline":"Modelling Data in Power BI using Power Query","datePublished":"2023-12-29T22:03:24+00:00","dateModified":"2023-12-29T22:05:34+00:00","mainEntityOfPage":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/"},"wordCount":1457,"commentCount":0,"image":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage"},"thumbnailUrl":"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg","articleSection":["Blog","Power-BI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/","url":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/","name":"Modelling Data in Power BI using Power Query - NewDataLabs","isPartOf":{"@id":"https:\/\/newdatalabs.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage"},"image":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage"},"thumbnailUrl":"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg","datePublished":"2023-12-29T22:03:24+00:00","dateModified":"2023-12-29T22:05:34+00:00","author":{"@id":"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29"},"breadcrumb":{"@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#primaryimage","url":"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg","contentUrl":"https:\/\/newdatalabs.com\/en\/wp-content\/uploads\/2023\/12\/blog-1.jpg","width":360,"height":216},{"@type":"BreadcrumbList","@id":"https:\/\/newdatalabs.com\/en\/modelling-data-in-power-bi-using-power-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/newdatalabs.com\/en\/"},{"@type":"ListItem","position":2,"name":"Modelling Data in Power BI using Power Query"}]},{"@type":"WebSite","@id":"https:\/\/newdatalabs.com\/en\/#website","url":"https:\/\/newdatalabs.com\/en\/","name":"NewDataLabs","description":"Tableau - Business Intelligence Tools","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/newdatalabs.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/dfa2df2f2fb6fcecdd8f69f00cffba29","name":"Barbara","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/newdatalabs.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8805976098f215eb8413b85141c17705f7ac9d91ccc0f83881d7eae1eab8c7f1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8805976098f215eb8413b85141c17705f7ac9d91ccc0f83881d7eae1eab8c7f1?s=96&d=mm&r=g","caption":"Barbara"}}]}},"_links":{"self":[{"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/posts\/2719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/comments?post=2719"}],"version-history":[{"count":4,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/posts\/2719\/revisions"}],"predecessor-version":[{"id":2738,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/posts\/2719\/revisions\/2738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/media\/2734"}],"wp:attachment":[{"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/media?parent=2719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/categories?post=2719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newdatalabs.com\/en\/wp-json\/wp\/v2\/tags?post=2719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}