{"id":21159,"date":"2019-11-22T09:03:06","date_gmt":"2019-11-22T09:03:06","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=21159"},"modified":"2024-01-08T12:05:38","modified_gmt":"2024-01-08T06:35:38","slug":"how-to-modify-power-bi-report-data-source-queries-from-advance-editor","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/11\/how-to-modify-power-bi-report-data-source-queries-from-advance-editor\/","title":{"rendered":"How to modify Data Source Queries of Power BI Report using Advanced Editor"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p><em>When data is added using\u00a0the <strong>Get Data<\/strong>\u00a0button by connecting to the services, Power BI generates a query in the background and we can modify this query and its data sources using the \u2018<strong>Advanced Editor<\/strong>\u2019 Button.<\/em><\/p>\n<p>Recently, we had a business requirement from one of our old clients to create\u00a0a <a href=\"https:\/\/www.inogic.com\/blog\/2020\/12\/send-power-bi-report-and-dashboard-details-by-email\/\">Power BI report<\/a>. Thus, we created a Power BI report for the Sandbox environment. After creating the report, we had to execute the same report for the Production environment. Usually, we change the report data source from \u2018<strong>Data Source Setting<\/strong>\u2019 as there is a \u2018<strong>Change Source<\/strong>\u2019 Button available to change the report data source. But in our case, the \u2018<strong>Change Source<\/strong>\u2019 button was not enabled and we were not able to change the data source of the Power BI report using it. After a thorough search, we understood that we could customize the report data source and data source queries using the\u00a0<strong>Advanced Editor<\/strong>.<\/p>\n<p><em>Here, is a look into the steps that we followed to change the Data Source using Advanced Editor.<\/em><\/p>\n<p>In the following case, we have added\u00a0<strong>Account\u00a0<\/strong>and<strong>\u00a0Contact<\/strong>\u00a0entity data for the Sandbox environment from Common Data Service using the \u2018<strong>Get Data\u2019<\/strong>\u00a0button. Now, we want to execute the same report for the Production environment. To do the same follow the steps given below:<\/p>\n<p><strong>1<\/strong>. Make a copy of the Power BI report created for the Sandbox environment and rename it. After renaming, open a new report (i.e. renamed report) in Power BI Desktop.<\/p>\n<p><strong><em>Note: The Power BI report name must be unique<\/em><\/strong><\/p>\n<p><strong>2<\/strong>. Then, click on the \u2018<strong>Edit Queries<\/strong>\u2019 button to edit the data source query as highlighted below<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21166\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/1modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"996\" height=\"413\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/1modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 996w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/1modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x124.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/1modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x318.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/1modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x274.png 660w\" sizes=\"(max-width: 996px) 100vw, 996px\" \/><\/p>\n<p><strong>3<\/strong>. After that you will be redirected to the new window, which will show you the data sources of your Power BI report.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21165\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"1151\" height=\"495\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 1151w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x129.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x330.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-1024x440.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/2modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x284.png 660w\" sizes=\"(max-width: 1151px) 100vw, 1151px\" \/><\/p>\n<p><strong>4<\/strong>. Then, select query from data source queries and click on \u2018<strong>Advanced Editor<\/strong>\u2019 Button as shown below. Here, I am editing the data source of <strong>Account<\/strong> entity query.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21164\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"1150\" height=\"507\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 1150w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x132.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x339.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-1024x451.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/3modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x291.png 660w\" sizes=\"(max-width: 1150px) 100vw, 1150px\" \/><\/p>\n<p><strong>5<\/strong>. After you click on the \u2018Advanced Editor\u2019 button, you can see the query for\u00a0the <strong>Account<\/strong>\u00a0entity in the Advanced Editor Window. To change the Data Source of your report, you just need to change the API URL (i.e. you need to add the URL of the Dynamics CRM environment to which you want to move this report) as highlighted below. Click on the \u2018<strong>Done<\/strong>\u2019 button.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21163\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/4modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"976\" height=\"373\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/4modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 976w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/4modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x115.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/4modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x294.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/4modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x252.png 660w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/p>\n<blockquote><p><strong><em>Note: This will work only if columns (i.e. attributes) selected in Power BI data source are present in other environment in which you are going to run this report.<\/em><\/strong><\/p><\/blockquote>\n<p><strong>6<\/strong>. Next, click on the \u2018<strong>Close &amp; Apply<\/strong>\u2019 Button to apply changes to the Power BI report. You will see the data of the newly added Dynamics CRM environment in the Power BI report.<\/p>\n<p><em>In the same way, we can modify other query parts as well.<\/em><\/p>\n<p><strong>For example:<\/strong>\u00a0Suppose, you have removed unnecessary columns from data source queries using the \u2018<strong>Choose Columns<\/strong>\u2019 button and you want to add any of those removed columns in the data source or want to remove the selected column. We can do this with the help of\u00a0<strong>Advanced Editor<\/strong>.<\/p>\n<p><em>Now let\u2019s see how it is done<\/em><\/p>\n<ul>\n<li>Once we remove the columns from the data source using the \u2018<strong>Choose Columns<\/strong>\u2019 button, the new query line will get added to the data source queries. So, we just need to modify that particular remove columns query line (i.e. \u2018<strong>Removed Other Columns\u2019<\/strong>\u00a0query line) from\u00a0the <strong>Advanced Editor<\/strong><\/li>\n<li>In my case, I have selected a few columns from\u00a0the <strong>Account<\/strong>\u00a0entity using the \u2018<strong>Choose Columns<\/strong>\u2019 button. In Advanced Editor, the new query line is added to choose selected columns and remove other columns as shown below:<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21162\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/5modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"816\" height=\"393\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/5modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 816w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/5modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x144.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/5modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x370.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/5modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x318.png 660w\" sizes=\"(max-width: 816px) 100vw, 816px\" \/><\/p>\n<ul>\n<li>Here, I want to add \u2018<strong>Account Number<\/strong>\u2019 column of Account entity in Power BI report data source. So, we can add the column in \u2018<strong>Removed Other Columns<\/strong>\u2019 query line as shown below:<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21161\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/6modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"814\" height=\"393\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/6modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 814w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/6modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x145.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/6modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x371.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/6modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x319.png 660w\" sizes=\"(max-width: 814px) 100vw, 814px\" \/><\/p>\n<ul>\n<li>Once you click on \u2018<strong>Done<\/strong>\u2019 button you will be able to see that column in Fields section of Power BI report as highlighted below:<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-21160\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png\" alt=\"modify Power BI Report Data Source Queries from Advance Editor\" width=\"1347\" height=\"564\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor.png 1347w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-300x126.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-768x322.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-1024x429.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/11\/7modify-Power-BI-Report-Data-Source-Queries-from-Advance-Editor-660x276.png 660w\" sizes=\"(max-width: 1347px) 100vw, 1347px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>In this way, by using \u2018<strong>Advanced Editor<\/strong>\u2019 button we can easily change the Data Source of the Power BI report as well as edit the Data source queries.<\/p>\n<h3><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:13px;margin-bottom:20px\"><div class=\"su-heading-inner\">Want to enhance business operations with interactive data visualization?<\/div><\/div><\/h3>\n<p><em>Switch to <a target=\"\" rel=\"noopener\">Power BI for Online, Desktops, and Dashboards<\/a><\/em> with Inogic- Professional Services Division<br \/>\nConnect at <a target=\"\" rel=\"noopener\">crm@inogic.com<\/a> and subscribe to complete assistance in shouldering the complex operations of revamping the intricate processes in the background related to Power BI<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction When data is added using\u00a0the Get Data\u00a0button by connecting to the services, Power BI generates a query in the background and we can modify this query and its data sources using the \u2018Advanced Editor\u2019 Button. Recently, we had a business requirement from one of our old clients to create\u00a0a Power BI report. Thus, we\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/11\/how-to-modify-power-bi-report-data-source-queries-from-advance-editor\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":21168,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18,19,45],"tags":[1339],"class_list":["post-21159","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365-v9-2","category-dynamics-crm","category-power-bi","tag-power-bi"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/21159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=21159"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/21159\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/21168"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=21159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=21159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=21159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}