<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Change From Import Mode to Direct Query (SQL Server Database)- SUCCESS STORY /working with Dual Mode in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Change-From-Import-Mode-to-Direct-Query-SQL-Server-Database/m-p/808583#M20971</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to share with you a solution on how you could change a connection (SQL Server Database in my case) from import/dual to direct query in a report with no need to recreate tables, measures, relationships and such.&lt;/P&gt;&lt;P&gt;First of all, kudos to radacad (&lt;A href="https://radacad.com/exposing-m-code-and-query-metadata-of-power-bi-pbix-file" target="_self"&gt;https://radacad.com/exposing-m-code-and-query-metadata-of-power-bi-pbix-file&lt;/A&gt;) from where I got an insight on exploring a pbix file. Apart from that I have devised this way myself so sorry if I repated someone's post. I couldn't find anything useful online for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instructions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Export your pbix report to a template (it will save all features and visuals of your report so don't worry). You will get a pbit file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/197515iF731BD5EA4E40901/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Change the pbit file extension to zip.&lt;/P&gt;&lt;P&gt;3) From an archive pull out two files: DataMashup, DataModelSchema.&lt;/P&gt;&lt;P&gt;4) Edit the DataMashup file (I used Notepad++) and replace a string&amp;nbsp;&lt;STRONG&gt;"IsDirectQuery" Value="l0&lt;/STRONG&gt;" with&amp;nbsp;&lt;STRONG&gt;"IsDirectQuery" Value="l1&lt;/STRONG&gt;" for all desired tables/queries.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;lt;/Item&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;ItemLocation&amp;gt;&amp;lt;ItemType&amp;gt;Formula&amp;lt;/ItemType&amp;gt;&amp;lt;ItemPath&amp;gt;Section1/Product&amp;lt;/ItemPath&amp;gt;&amp;lt;/ItemLocation&amp;gt;&amp;lt;StableEntries&amp;gt;&amp;lt;Entry Type="IsPrivate" Value="l0" /&amp;gt;&amp;lt;Entry Type=&lt;STRONG&gt;"IsDirectQuery" Value="l0&lt;/STRONG&gt;" /&amp;gt;&amp;lt;Entry Type="NavigationStepName" Value="sNavigation"&lt;/P&gt;&lt;P&gt;5) Edit the DataModelScgema file.&amp;nbsp;Replace a string&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;"mode": "import" or&amp;nbsp;"mode": "dual" with&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;"mode": "directQuery"&amp;nbsp;&lt;/STRONG&gt;for all desired tables/queries (should be aligned with tables/queries from the fourth point).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;"partitions": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Product-17398375-891d-4c0f-bc87-a201e584788f",&lt;BR /&gt;&lt;STRONG&gt;"mode": "directQuery",&lt;/STRONG&gt;&lt;BR /&gt;"state": "ready",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6) Overwirte both files in the zip file with edited ones and change the extension of the zip file back to pbit.&lt;/P&gt;&lt;P&gt;7) Open the pbit file. Deny if asked to apply changes. Go to Edit queries and press Refresh all.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Exit the Edit queries window and save your file as a pbix report.&lt;/P&gt;&lt;P&gt;9) Press Refresh in a main window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should have all desired tables/queries switched to Direct Query preserving measures and relationships.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you would be as successfull as I was.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radoslaw Hagno&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2019 07:03:06 GMT</pubDate>
    <dc:creator>rh90210</dc:creator>
    <dc:date>2019-10-03T07:03:06Z</dc:date>
    <item>
      <title>Change From Import Mode to Direct Query (SQL Server Database)- SUCCESS STORY /working with Dual Mode</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Change-From-Import-Mode-to-Direct-Query-SQL-Server-Database/m-p/808583#M20971</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to share with you a solution on how you could change a connection (SQL Server Database in my case) from import/dual to direct query in a report with no need to recreate tables, measures, relationships and such.&lt;/P&gt;&lt;P&gt;First of all, kudos to radacad (&lt;A href="https://radacad.com/exposing-m-code-and-query-metadata-of-power-bi-pbix-file" target="_self"&gt;https://radacad.com/exposing-m-code-and-query-metadata-of-power-bi-pbix-file&lt;/A&gt;) from where I got an insight on exploring a pbix file. Apart from that I have devised this way myself so sorry if I repated someone's post. I couldn't find anything useful online for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Instructions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Export your pbix report to a template (it will save all features and visuals of your report so don't worry). You will get a pbit file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.PNG" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/197515iF731BD5EA4E40901/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1.PNG" alt="1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Change the pbit file extension to zip.&lt;/P&gt;&lt;P&gt;3) From an archive pull out two files: DataMashup, DataModelSchema.&lt;/P&gt;&lt;P&gt;4) Edit the DataMashup file (I used Notepad++) and replace a string&amp;nbsp;&lt;STRONG&gt;"IsDirectQuery" Value="l0&lt;/STRONG&gt;" with&amp;nbsp;&lt;STRONG&gt;"IsDirectQuery" Value="l1&lt;/STRONG&gt;" for all desired tables/queries.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;lt;/Item&amp;gt;&amp;lt;Item&amp;gt;&amp;lt;ItemLocation&amp;gt;&amp;lt;ItemType&amp;gt;Formula&amp;lt;/ItemType&amp;gt;&amp;lt;ItemPath&amp;gt;Section1/Product&amp;lt;/ItemPath&amp;gt;&amp;lt;/ItemLocation&amp;gt;&amp;lt;StableEntries&amp;gt;&amp;lt;Entry Type="IsPrivate" Value="l0" /&amp;gt;&amp;lt;Entry Type=&lt;STRONG&gt;"IsDirectQuery" Value="l0&lt;/STRONG&gt;" /&amp;gt;&amp;lt;Entry Type="NavigationStepName" Value="sNavigation"&lt;/P&gt;&lt;P&gt;5) Edit the DataModelScgema file.&amp;nbsp;Replace a string&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;"mode": "import" or&amp;nbsp;"mode": "dual" with&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;"mode": "directQuery"&amp;nbsp;&lt;/STRONG&gt;for all desired tables/queries (should be aligned with tables/queries from the fourth point).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example :&lt;/P&gt;&lt;P&gt;"partitions": [&lt;BR /&gt;{&lt;BR /&gt;"name": "Product-17398375-891d-4c0f-bc87-a201e584788f",&lt;BR /&gt;&lt;STRONG&gt;"mode": "directQuery",&lt;/STRONG&gt;&lt;BR /&gt;"state": "ready",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6) Overwirte both files in the zip file with edited ones and change the extension of the zip file back to pbit.&lt;/P&gt;&lt;P&gt;7) Open the pbit file. Deny if asked to apply changes. Go to Edit queries and press Refresh all.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; Exit the Edit queries window and save your file as a pbix report.&lt;/P&gt;&lt;P&gt;9) Press Refresh in a main window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should have all desired tables/queries switched to Direct Query preserving measures and relationships.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you would be as successfull as I was.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radoslaw Hagno&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 07:03:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Change-From-Import-Mode-to-Direct-Query-SQL-Server-Database/m-p/808583#M20971</guid>
      <dc:creator>rh90210</dc:creator>
      <dc:date>2019-10-03T07:03:06Z</dc:date>
    </item>
  </channel>
</rss>

