{"id":891,"date":"2020-07-30T19:54:55","date_gmt":"2020-07-30T19:54:55","guid":{"rendered":"http:\/\/jackofalltradesmasterofsome.com\/blog\/?p=891"},"modified":"2020-07-31T17:55:35","modified_gmt":"2020-07-31T17:55:35","slug":"direct-quer-denodo-from-power-bi-m-query","status":"publish","type":"post","link":"http:\/\/jackofalltradesmasterofsome.com\/blog\/2020\/07\/30\/direct-quer-denodo-from-power-bi-m-query\/","title":{"rendered":"Direct Custom SQL Query Denodo from Power BI M Query"},"content":{"rendered":"\n<p>If you are planning to use Power BI on top of <a href=\"https:\/\/www.denodo.com\/en\">Denodo <\/a>sometimes a base view or a Power Query won&#8217;t be enough. If you need to embed your own complex query to pull data from Denodo, there are a few items you must be aware of. See below on how to Direct Custom SQL Query Denodo from Power BI M Query.<\/p>\n\n\n\n<p>1.  Create a Data Connection to Denodo <\/p>\n\n\n\n<p>2. Connect Power BI to Denodo using the ODBC Connections<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"198\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-3.png\" alt=\"\" class=\"wp-image-895\" srcset=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-3.png 681w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-3-300x87.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/figure>\n\n\n\n<p>3. Select Transform and Create a blank query in Power BI<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"289\" height=\"163\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-4.png\" alt=\"\" class=\"wp-image-896\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"310\" height=\"243\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-1.png\" alt=\"\" class=\"wp-image-893\" srcset=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-1.png 310w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-1-300x235.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"552\" height=\"354\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-5.png\" alt=\"\" class=\"wp-image-897\" srcset=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-5.png 552w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-5-300x192.png 300w\" sizes=\"auto, (max-width: 552px) 100vw, 552px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"334\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-6.png\" alt=\"\" class=\"wp-image-898\" srcset=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-6.png 593w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-6-300x169.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>In the Advanced Editor, Place in your query which you can copy from below as a starter template<ol type=\"a\"><li>All table names are case sensitive. The source queries were not and the developers may have missed some<\/li><li>All table and column names need 2 double quotes on each side<\/li><li>Basic SQL functions like Left or ConCat may give you issues. Be sure to read the documentation on other ways to emulate this functions. <\/li><\/ol><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"335\" src=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-7.png\" alt=\"\" class=\"wp-image-899\" srcset=\"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-7.png 768w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-7-300x131.png 300w, http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-content\/uploads\/2020\/07\/image-7-765x335.png 765w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p><strong>Sample Query<\/strong><\/p>\n\n\n\n<p>let<br> &nbsp; &nbsp; Source = Odbc.Query(&#8220;dsn=Denodo_ServerName&#8221;, &#8220;SELECT Sum(&#8220;&#8221;Amount&#8221;&#8221;) AS  Amount<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,&#8221;&#8221;Column1&#8243;&#8221;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,&#8221;&#8221; Column2&#8243;&#8221;<br> &nbsp; &nbsp; &nbsp; FROM &#8220;&#8221;vw_Viewname&#8221;&#8221;<br> &nbsp; &nbsp; &nbsp; WHERE &#8220;&#8221; Column3&#8243;&#8221; = 0<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND &#8220;&#8221; Column4&#8243;&#8221; = 0<br> &nbsp; &nbsp; &nbsp; GROUP BY &#8220;&#8221; Column1 &#8220;&#8221;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ,&#8221;&#8221; Column2 &#8220;&#8221;&#8221;)&nbsp;<br> in<br> &nbsp; &nbsp; Source<\/p>\n\n\n\n<p>Direct Custom SQL Query Denodo from Power BI M Query<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are planning to use Power BI on top of Denodo sometimes a base view or a Power Query won&#8217;t be enough. If you need to embed your own complex query to pull data from Denodo, there are a few items you must be aware of. See below on how to Direct Custom SQL [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":900,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,11],"tags":[100,84],"class_list":["post-891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-data-warehouse","tag-denodo","tag-sql-server"],"_links":{"self":[{"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":5,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":905,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/posts\/891\/revisions\/905"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/media\/900"}],"wp:attachment":[{"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jackofalltradesmasterofsome.com\/blog\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}