{"id":32272,"date":"2021-01-15T14:20:44","date_gmt":"2021-01-15T14:20:44","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=32272"},"modified":"2022-03-16T05:43:23","modified_gmt":"2022-03-16T05:43:23","slug":"creating-relationships-in-power-bi-desktop","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/","title":{"rendered":"Creating relationships in Power BI Desktop"},"content":{"rendered":"\n<p>Null values, blank values, and duplicate values restrict you from forming associations when loading detailed data sets from various sources. For example, when we load data sets from active customer support requests as well as another data set of work items with schemas of:<\/p>\n\n\n\n<p><strong>CustomerIncidents: {IncidentID, CustomerName, IssueName, OpenedDate, Status} WorkItems: {WorkItemID, IncidentID, WorkItemName, OpenedDate, Status, CustomerName }<\/strong><\/p>\n\n\n\n<p>As a result, we can&#8217;t simply construct a link between these two data sets to monitor all occurrences and work items related to a single CustomerName. Because certain WorkItems aren&#8217;t associated with a CustomerName, that field will be left blank or NULL. For each given CustomerName, there might be several records in WorkItems and CustomerIncidents.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Steps for creating relationships in Power BI Desktop (with data having null or blank values)<\/strong><\/h4>\n\n\n\n<p>Columns having null or blank values are common in data sets. However, this might cause problems when attempting to leverage relationships. As a result, you effectively have two alternatives for dealing with the problems.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, you can remove the rows that have null or blank values. <\/li><li>Secondly, you can do this using either the filter feature in the query tab or if in case you are merging queries, select the &#8220;keep only matching rows&#8221; option. <\/li><\/ul>\n\n\n\n<p>Furthermore, you may substitute null or blank values for values that function in relationships, such as &#8220;NULL&#8221; and &#8220;(Blank)&#8221;. Filtering out data at the query step does indeed delete records, affecting summary statistics and computations. The latter method retains the data rows, however, it may cause miscalculations in the model by making unconnected rows look linked. If you choose the latter option, make sure to apply filters in the View\/Chart to get correct results. Most essential, determine which rows are preserved and which are eliminated, as well as the overall influence on the analysis.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"creating-relationships-in-power-bi-desktop-when-the-data-has-duplicate-values\"><strong>Steps to create relationships in Power BI Desktop when the data has duplicate values<\/strong><\/h4>\n\n\n\n<p>Duplicate data values restrict you from forming associations when loading comprehensive data sets from numerous sources. You can also get around this by establishing a dimension table that has unique values from both data sources. So, if we load data sets from active customer support requests and a data set of work items using the following schemas &#8211;<\/p>\n\n\n\n<p><strong>CustomerInicdents: {IncidentID, CustomerName, IssueName, OpenedDate, Status} WorkItems: {WorkItemID, IncidentID, WorkItemName, OpenedDate, Status, CustomerName }<\/strong><\/p>\n\n\n\n<p>We can&#8217;t just construct a link between these two data sets to monitor all events and work items related to a given CustomerName. Because certain WorkItems aren&#8217;t associated with a CustomerName, that field will be left blank or NULL. If the CustomerNames database has any null or blank values, you may still be unable to construct a relationship &#8211; see Creating relationships if my data contains null or blank values. For a single CustomerName, there might be several WorkItems and CustomerIncidents.<\/p>\n\n\n\n<p>In order to establish a connection, we must first build a logical data set that contains all of the CustomerNames from both data sets. To build the logical data set, go to the Query tab and follow the steps below:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Firstly, duplicate both queries, naming the first&nbsp;<strong>Temp<\/strong>&nbsp;and the second&nbsp;<strong>CustomerNames<\/strong>.<\/li><li>Secondly, in each query, remove all columns&nbsp;<em>except<\/em>&nbsp;the CustomerName column<\/li><li>Thirdly, In each query, use&nbsp;<strong>Remove Duplicate<\/strong>.<\/li><li>Then, in the&nbsp;<strong>CustomerNames<\/strong>&nbsp;query, select the&nbsp;<strong>Append<\/strong>&nbsp;option in the ribbon, select the query&nbsp;<strong>Temp<\/strong>.<\/li><li>Lastly, in the&nbsp;<strong>CustomerNames<\/strong>&nbsp;query, select&nbsp;<strong>Remove Duplicates<\/strong>.<\/li><\/ol>\n\n\n\n<p>Then you will have a dimension table that you can use to relate to CustomerIncidents and WorkItems that contains all the values of each.<\/p>\n\n\n\n<p>For More visits &#8211; <a href=\"https:\/\/docs.microsoft.com\/en-us\/power-bi\/create-reports\/desktop-tips-and-tricks-for-creating-reports#tips-and-tricks-for-creating-relationships-in-power-bi-desktop\" target=\"_blank\" rel=\"noreferrer noopener\">Resolve inconsistencies by creating relationships in Power BI Desktop<\/a><\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.testpreptraining.ai\/analyzing-data-with-microsoft-power-bi-da-100-free-test\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"961\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png\" alt=\"Microsoft Exam DA-100 Free Practice Test\" class=\"wp-image-31483\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png 961w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test-750x117.png 750w\" sizes=\"auto, (max-width: 961px) 100vw, 961px\" \/><\/a><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Null values, blank values, and duplicate values restrict you from forming associations when loading detailed data sets from various sources. For example, when we load data sets from active customer support requests as well as another data set of work items with schemas of: CustomerIncidents: {IncidentID, CustomerName, IssueName, OpenedDate, Status} WorkItems: {WorkItemID, IncidentID, WorkItemName, OpenedDate,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-32272","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating relationships in Power BI Desktop | Testprep Training<\/title>\n<meta name=\"description\" content=\"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating relationships in Power BI Desktop | Testprep Training\" \/>\n<meta property=\"og:description\" content=\"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-16T05:43:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/\",\"name\":\"Creating relationships in Power BI Desktop | Testprep Training\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2021-01-15T14:20:44+00:00\",\"dateModified\":\"2022-03-16T05:43:23+00:00\",\"description\":\"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating relationships in Power BI Desktop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating relationships in Power BI Desktop | Testprep Training","description":"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!","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:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/","og_locale":"en_US","og_type":"article","og_title":"Creating relationships in Power BI Desktop | Testprep Training","og_description":"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2022-03-16T05:43:23+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Microsoft-Exam-DA-100-Free-Practice-Test.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/","name":"Creating relationships in Power BI Desktop | Testprep Training","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2021-01-15T14:20:44+00:00","dateModified":"2022-03-16T05:43:23+00:00","description":"Get ready to qualify Microsoft Exam DA-100 with the latest practice test. Learn about data statistics using Power Query and Power View Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/creating-relationships-in-power-bi-desktop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Creating relationships in Power BI Desktop"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=32272"}],"version-history":[{"count":6,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32272\/revisions"}],"predecessor-version":[{"id":52929,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32272\/revisions\/52929"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=32272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=32272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=32272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}