<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Power Query &#8211; Prologika</title>
	<atom:link href="https://prologika.com/tag/power-query/feed/" rel="self" type="application/rss+xml" />
	<link>https://prologika.com</link>
	<description>Business Intelligence Consulting and Training in Atlanta</description>
	<lastBuildDate>Mon, 25 Jul 2022 12:01:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.3</generator>
	<item>
		<title>Atlanta MS BI and Power BI Group Meeting on August 1st (Power BI Automation)</title>
		<link>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-202208/</link>
					<comments>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-202208/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Mon, 25 Jul 2022 12:01:43 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Atlanta.MBI]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=8575</guid>

					<description><![CDATA[Please join us online for the next Atlanta MS BI and Power BI Group meeting on Monday, August 1st, at 6:30 PM ET.  We&#8217;ll have two presentations by 3Cloud. For [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Please join us online for the next Atlanta MS BI and Power BI Group meeting on Monday, August 1st, at 6:30 PM ET.  We&#8217;ll have two presentations by 3Cloud. For more details and sign up, visit our <a href="https://www.meetup.com/Atlanta-Microsoft-Business-Intelligence-Users/">group page</a>.</p>
<table width="100%">
<tbody>
<tr>
<td width="132"><strong>Presentation:</strong></td>
<td width="491">1.   “Power BI Meets Programmability – TOM, XMLA, and C#” by Kristyna Hughes</p>
<p>2.  “Automation Using Tabular Editor Advanced Scripting” by Tim Keeler</td>
</tr>
<tr>
<td width="132"><strong>Date:</strong></td>
<td width="491">August 1st</td>
</tr>
<tr>
<td width="132"><strong>Time:</strong></td>
<td width="491">6:30 – 8:30 PM ET</td>
</tr>
<tr>
<td width="132"><strong>Place:</strong></td>
<td width="491"><a href="https://teams.microsoft.com/l/meetup-join/19%3ameeting_NzEyOWQ1MTItODMwNC00NGViLTg3NDAtM2Y3NDhiY2Q4ODBi%40thread.v2/0?context=%7b%22Tid%22%3a%22e7b81d0a-a949-4103-83dc-feff6277c109%22%2c%22Oid%22%3a%228b6a39f9-03a0-4118-b057-cfd26416a35c%22%7d">Click here to join the meeting</a></td>
</tr>
<tr>
<td width="132"><strong>Overview:</strong></td>
<td width="491"><strong>Power BI Meets Programmability – TOM, XMLA, and C#</strong></p>
<p>Tune in to learn how to programmatically add columns and measures to Power BI data models using TOM, XMLA, and C#! XMLA is a powerful tool available in the online Power BI service that allows report developers to connect to their data model and adjust a variety of entities outside the Power BI Desktop application. Combined with a .NET application, this can be a powerful tool in deploying changes to your Power BI data models programmatically.</p>
<p><strong>Automation Using Tabular Editor Advanced Scripting</strong></p>
<p>See examples of how advanced scripting in Tabular Editor can be used to automate the creation of DAX measures, calculation groups, and provide insights into your model while reducing development time and manual effort.</td>
</tr>
<tr>
<td width="132"><strong>Speaker:</strong></td>
<td width="491">Kristyna Hughes’s experience includes implementing and managing enterprise-level Power BI instance, training teams on reporting best practices, and building templates for scalable analytics. Currently, Kristina is a data &amp; analytics consultant at 3Cloud and enjoy answering qualitative questions with quantitative answers. Check out my blog at <a href="https://dataonwheels.wordpress.com/">https://dataonwheels.wordpress.com/</a> and connect on LinkedIn <a href="https://www.linkedin.com/in/kristyna-hughes-dataonwheels/">https://www.linkedin.com/in/kristyna-hughes-dataonwheels/</a></p>
<p>Tim Keeler is a data analytics professional with over 17 years of experience developing cost-to-serve models, business intelligence solutions, and managing teams of other data professionals to help organizations achieve their strategic objectives. Check my blog at https://www.linkedin.com/in/tim-keeler-32631912/</td>
</tr>
<tr>
<td width="132"><strong>Prototypes without Pizza</strong></td>
<td width="491">Power BI Latest</td>
</tr>
</tbody>
</table>
<p><a href="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png" rel="attachment wp-att-6368"><img decoding="async" class="alignnone size-full wp-image-6368" src="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png" alt="PowerBILogo" width="410" height="109" srcset="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png 410w, https://prologika.com/wp-content/uploads/2019/10/PowerBILogo-300x80.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-202208/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Atlanta MS BI and Power BI Group Meeting on July 11th (Pushing the Query Folding limits with Power Query)</title>
		<link>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-20220711/</link>
					<comments>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-20220711/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Sat, 02 Jul 2022 21:32:21 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Atlanta.MBI]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=8564</guid>

					<description><![CDATA[Please join us online for the next Atlanta MS BI and Power BI Group meeting on Monday, July 11th, at 6:30 PM ET.  For more details and sign up, visit [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Please join us online for the next Atlanta MS BI and Power BI Group meeting on Monday, July 11th, at 6:30 PM ET.  For more details and sign up, visit our <a href="https://www.meetup.com/Atlanta-Microsoft-Business-Intelligence-Users/">group page</a>.</p>
<table width="100%">
<tbody>
<tr>
<td width="132"><strong>Presentation:</strong></td>
<td width="491">Pushing the Query Folding limits with Power Query</td>
</tr>
<tr>
<td width="132"><strong>Date:</strong></td>
<td width="491">July 11th</td>
</tr>
<tr>
<td width="132"><strong>Time:</strong></td>
<td width="491">6:30 – 8:30 PM ET</td>
</tr>
<tr>
<td width="132"><strong>Place:</strong></td>
<td width="491"><a href="https://teams.microsoft.com/l/meetup-join/19%3ameeting_M2U5ODM3ZGQtNTAwZS00ZGE2LWJhYTEtOGY1ODg2ZDY1NDc0%40thread.v2/0?context=%7b%22Tid%22%3a%22e7b81d0a-a949-4103-83dc-feff6277c109%22%2c%22Oid%22%3a%228b6a39f9-03a0-4118-b057-cfd26416a35c%22%7d">Click here to join the meeting</a></td>
</tr>
<tr>
<td width="132"><strong>Overview:</strong></td>
<td width="491">One of Power Query’s most powerful features is its ability to translate the Power Query formula language (M) back to a source systems native language and in this session, we’ll push the limits and possibilities to avoid “breaking the fold” and explore some potential dark magic with List functions. A base understanding of T-SQL is helpful though not required for this session.</td>
</tr>
<tr>
<td width="132"><strong>Speaker:</strong></td>
<td width="491">From financial services to felines, the World Wide Web to professional wrestling &#8211; Alex Powers has an affinity for the conventional and unconventional when it comes to information. A self-proclaimed Excel and Power BI Enthusiast Alex Powers enjoys contributing to online forums and sharing his passion for empowering others using Microsoft technologies.</td>
</tr>
<tr>
<td width="132"><strong>Prototypes without Pizza</strong></td>
<td width="491">Power BI Latest</td>
</tr>
</tbody>
</table>
<p><a href="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png" rel="attachment wp-att-6368"><img decoding="async" class="alignnone size-full wp-image-6368" src="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png" alt="PowerBILogo" width="410" height="109" srcset="https://prologika.com/wp-content/uploads/2019/10/PowerBILogo.png 410w, https://prologika.com/wp-content/uploads/2019/10/PowerBILogo-300x80.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/atlanta-ms-bi-and-power-bi-group-meeting-20220711/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Power BI Dynamic M Query Parameters – Another Opportunity Missed for DirectQuery Users</title>
		<link>https://prologika.com/power-bi-dynamic-m-query-parameters-another-opportunity-missed-for-directquery-users/</link>
					<comments>https://prologika.com/power-bi-dynamic-m-query-parameters-another-opportunity-missed-for-directquery-users/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Wed, 21 Oct 2020 12:13:00 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=7455</guid>

					<description><![CDATA[UPDATE 17-Feb-2022: Dynamic query parameters now support popular relational data sources, and I posted an updated blog. I had recently a Power BI advisory engagement for a large ISV. They [&#8230;]]]></description>
										<content:encoded><![CDATA[<blockquote><p>UPDATE 17-Feb-2022: Dynamic query parameters now support popular relational data sources, and I posted an updated <a href="https://prologika.com/power-bi-dynamic-m-query-parameters-reloaded/">blog</a>.</p></blockquote>
<p>I had recently a Power BI advisory engagement for a large ISV. They had many customers. and each customer data was hosted in its own database for security reasons, with all databases having an identical schema. Power BI reports had to connect using DirectQuery to avoid refreshing data (real-time BI). Naturally, the customer envisioned a single set of reports with the ability to switch the dataset connection to the respective database depending on the user identity and company association. In addition, they wanted to piggyback on the existing database security policies by having each visual call a stored procedure and pass the user identity as a dynamic parameter.</p>
<p>Can Power BI do this? Unfortunately, no. The main architectural issue is that although the model (VertiPaq) and query (Power Query) are bundled in Power BI Desktop (and in a single dataset when published), they are like two separate universes. Naturally, this is not an issue when data is imported, but it becomes important with DirectQuery. As it stands, the only communication between these two layers is when Power Query passes the data back to the model. You can define query parameters, but they are static, meaning that they must be specified on the dataset settings page in Power BI Service. In other words, query parameter can&#8217;t reference DAX constructs, such as USERPRINCIPALNAME(), and therefore can&#8217;t reference runtime conditions.</p>
<p>That&#8217;s why I initially rejoiced when Microsoft announced <a href="https://powerbi.microsoft.com/en-us/blog/power-bi-october-2020-feature-summary/">Dynamic M Query Parameters</a>, a feature that just went into public preview in the Power BI Desktop October 2020 release. Unfortunately, a better name of this feature would have been Kusto Dynamic Parameters since the primary design intent was to support Azure Data Explorer (internally named Kusto). It doesn&#8217;t apply to DirectQuery connections to most relational databases.</p>
<blockquote><p>Although there is no indication, Power BI has two types of connectors: native and M-based. Native connectors target most popular relational data sources: TSQL (Azure Database, SQL Server, Synapse), PLSQL (Oracle), Teradata and relational SAP Hana. Dynamic query parameters won&#8217;t work with native connectors. The rest (Microsoft provided and custom) are M-based. If an M connector supports DirectQuery, it should support dynamic query parameters too. For example, besides Azure Data Explorer, other M-based data source that supports DirectQuery and therefore dynamic parameters are Amazon Redshift, Showflake, and Google BigQuery.</p></blockquote>
<p>I hope Microsoft will revamp this feature to support the popular relational databases and DAX functions, so we can address more involved DirectQuery scenarios and make parameters really dynamics.</p>
<p><img decoding="async" src="https://prologika.com/wp-content/uploads/2020/10/102120_0037_PowerBIDyna1.png" alt="" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/power-bi-dynamic-m-query-parameters-another-opportunity-missed-for-directquery-users/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Power Query Merging on GUID Columns</title>
		<link>https://prologika.com/power-query-merging-on-guid-columns/</link>
					<comments>https://prologika.com/power-query-merging-on-guid-columns/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Sat, 10 Oct 2020 17:05:01 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=7431</guid>

					<description><![CDATA[Scenario: You are merging two tables in Power Query on GUID columns with Text data type. In my case, the first table (UserDim) came from Azure SQL DB and the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Scenario</strong>: You are merging two tables in Power Query on GUID columns with Text data type. In my case, the first table (UserDim) came from Azure SQL DB and the second (systemusers) from Dynamics CRM, but I believe the source is irrelevant. Then, you expand the second table in the next step after the merge, select the columns you need, and see expected results in the preview pane. However, when you apply the changes, the related columns are not populated (empty) in the Power BI data model. In other words, the join fails to find matches.</p>
<p><strong>Solution</strong>: I think there is some sort of a bug in Power Query. True, Power Query is case-sensitive so joining on the same text that differs in casing in the two columns would fail the match. However, in this case the guids were all lower case (or at least that&#8217;s how they appear in the preview). The only way I could explain the issue is that the refresh somehow converts the guid values to different casing before the join is performed. Anyhow, the problem was solved by adding an explicit step to convert both guid columns to lower case before the merge step.</p>
<p><img decoding="async" src="https://prologika.com/wp-content/uploads/2020/10/101020_1701_PowerQueryM1.png" alt="" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/power-query-merging-on-guid-columns/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Conquering Time Zones</title>
		<link>https://prologika.com/conquering-time-zones/</link>
					<comments>https://prologika.com/conquering-time-zones/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Thu, 16 Jul 2020 20:53:38 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=7326</guid>

					<description><![CDATA[A client has Power BI models connected to Dynamics Online. Dynamics stores all dates in UTC instead of keeping the time offset, such as 7/14/2020 1:21:29 AM +00:00. Naturally, the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A client has Power BI models connected to Dynamics Online. Dynamics stores all dates in UTC instead of keeping the time offset, such as 7/14/2020 1:21:29 AM +00:00. Naturally, the users want to see dates localized to the US Eastern Time zone. Easy, right? Use the Power Query ToLocal time transformation (in the Transform ribbon, expand Time, and then click To Local) to offset with the desired number of hours. But there are a few issues with this approach:</p>
<ol>
<li>It will work fine in Power BI Desktop (assuming you are on the Eastern Time zone because Power BI will pick your computer settings), but it won&#8217;t work when you publish the dataset to powerbi.com. The reason for this is that Microsoft sets the time zone of Azure servers to UTC <strong>irrespective</strong> of the geo location of the Power BI data center. So, when Power BI Service refreshes the dataset, it will convert dates to its local time (UTC) and the net effect is that the date remains unchanged.</li>
<li>You can attempt using the M DateTimeZone.SwitchZone function but for some obscure reason, casting the column data type to Date after the zone change puts the date back to UTC.</li>
<li>The hour offset changes depending on when the country switches to Daylight Saving Time.</li>
</ol>
<p>When the going gets though, the developer writes some code which in this case would be a Power Query ToTimeZone query function.</p>
<pre><span style="font-family: Courier New;"># open a Power Query blank query in Advanced Query mode and paste the code. Then rename the query to ToTimeZone
</span><span style="font-family: Courier New;">let
</span><span style="font-family: Courier New;"> Source = (UTCTime, TimeOffset) =&gt;
</span><span style="font-family: Courier New;">let
</span><span style="font-family: Courier New;"> CurrentYear = Date.Year(DateTime.FixedLocalNow()),
</span><span style="font-family: Courier New;"> DST_Start = Date.StartOfWeek(#datetimezone(CurrentYear,3,14,0,0,0,TimeOffset,0),Day.Sunday) + #duration(0,2,0,0),
</span><span style="font-family: Courier New;"> DST_End = Date.StartOfWeek(#datetimezone(CurrentYear,11,7,0,0,0,TimeOffset+1,0),Day.Sunday) + #duration(0,2,0,0),
</span><span style="font-family: Courier New;"> OffsetTime = if UTCTime &gt;= DST_Start and UTCTime &lt; DST_End then TimeOffset + 1 else TimeOffset,
</span><span style="font-family: Courier New;"> #"Change Time" = if UTCTime=null then null else DateTimeZone.RemoveZone(UTCTime) + #duration(0, AdjustDST, 0, 0)
</span><span style="font-family: Courier New;">in
</span><span style="font-family: Courier New;"> #"Change Time"
</span><span style="font-family: Courier New;">in
</span><span style="font-family: Courier New;"> Source
</span></pre>
<p>The function takes two arguments: UTCTime and TimeOffset. For each row, the source query will pass the date as of datetimezone data type. The TimeOffset is the default time offset outside Daylight Saving Time. So, for US Eastern time zone, the time offset will be -5. Notice that I don&#8217;t specify types for the arguments because you may have empty (null) dates. If null is passed to UTCTime, you&#8217;ll get a runtime error. Instead, the last line checks if the incoming date is null. The function adjusts the time offset during Daylight Saving Time. Finally, it removes the time zone from the original date, so we get the date in a datetime format and then adds the offset. So, 7/14/2020 1:21:29 AM +00:00 will become 7/13/2020 9:21:29 PM.</p>
<p>Once the ToTimeZone function is ready, we can call it from the source query, like so:</p>
<pre><span style="font-family: Courier New;">let
</span><span style="font-family: Courier New;"> Source = OData.Feed("https://&lt;tenant&gt;.crm.dynamics.com/api/data/v9.1/appointments ", null, [Implementation="2.0"]),
</span><span style="font-family: Courier New;"> ToLocalTimeZone = Table.TransformColumns(Source, {{"createdon", each <strong>ToTimeZone</strong>(_, -5)}, {"scheduledstart", each <strong>ToTimeZone</strong>(_, -5)}}),
</span><span style="font-family: Courier New;"> #"Changed Type" = Table.TransformColumnTypes(ToLocalTimeZone,{{"createdon", type date}})
</span><span style="font-family: Courier New;">in
</span><span style="font-family: Courier New;"> #"Changed Type"
</span></pre>
<p>Notice that I use the TransformColumn transformation so that I can convert multiple date columns in one line and don&#8217;t end up with additional custom columns. In other words, I&#8217;m updating the date columns in place. Finally, I change the data type to date so that I can join to a Date dimension.</p>
<p>You can easily extend this code to handle times in multiple time zones, such as to report the time depending on the geo location of the user who entered the data. This will require storing the user time zone, such as in the Dynamics systemusers table.</p>
<p><img decoding="async" src="https://prologika.com/wp-content/uploads/2020/07/071620_2041_ConcurringT1.jpg" alt="" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/conquering-time-zones/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>T-SQL, Power Query, or DAX?</title>
		<link>https://prologika.com/t-sql-power-query-or-dax/</link>
					<comments>https://prologika.com/t-sql-power-query-or-dax/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Sun, 20 Jan 2019 16:51:07 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[DAX]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=6082</guid>

					<description><![CDATA[I taught my Applied Power BI class last week to a group of smart data analysts. All of them were knowledgeable of T-SQL, which they have been using extensively for [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I taught my Applied Power BI class last week to a group of smart data analysts. All of them were knowledgeable of T-SQL, which they have been using extensively for years to shape and transform the data and produce SSRS, Qlik and now Power BI reports. They haven&#8217;t previously used Power Query, but they liked my overview of its features. However, they were rightfully confused when to use T-SQL, Power Query, or DAX. Starting with the data source and moving up the chain, Power BI lets you use expressions in:</p>
<ol>
<li>Data source (custom SQL Query, SQL view)</li>
<li>Power Query</li>
<li>DAX calculated columns</li>
<li>DAX measures (the uppermost level)</li>
</ol>
<blockquote><p>My advice is to invest time and learn all these capabilities. When you have diverse skills, you can use the best tool for the task at hand.</p></blockquote>
<p>Although is hard to generalize as every data transformation is different, I recommend you shape the data as upstream (closer to the data source) as possible. So, if you are familiar with T-SQL and that&#8217;s your primary data source, then use T-SQL. As one of the Microsoft best products, SQL Server has been enjoying 30 years of continuous improvements. Not only can you apply the skills you already have, but you will gain in performance when you use T-SQL and delegate data crunching to SQL Server which is what it&#8217;s designed to do. You can also benefit from the rich data manipulation features of T-SQL. These are the same reasons why I favor the ELT (Extract, Load and Transform) pattern in organizational BI solutions instead of SSIS data flow transforms. And if you find T-SQL lacking in features, Power Query can supplement it nicely, such as to fill down missing values, quickly unpivot data, or apply fuzzy lookup.</p>
<p>When you connect to data sources that don&#8217;t support SQL, such as flat files or Excel, the next natural place is Power Query to shape and transform the data. The choice between Power Query and DAX calculated columns is a tricky one and typically involves a compromise between performance and skill set. In many cases, you&#8217;ll find that a custom column can be implemented both in Power Query and DAX calculated columns. In general, if performance is OK, use Power Query, which is further upstream than DAX calculated columns. As a bonus, your data model will see the custom columns as regular columns and compress them equally well. Consider DAX calculated columns (one level up Power Query) when:</p>
<ul style="margin-left: 38pt;">
<li>You must use DAX features that Power Query lacks, such as ranking.</li>
<li>When Power Query transforms lead to long data refresh times, such as a lookup between two large tables.</li>
</ul>
<p>Finally, while custom columns can be often implemented in any of the first three layers, DAX measures are unique, and they typically can be implemented in DAX only. For example, if you need the expression to reflect the end user filter selection, you must use a DAX measure because only DAX measures are evaluated at run time and can access runtime conditions, such as values from filters and slicers.</p>
<p><img decoding="async" src="https://prologika.com/wp-content/uploads/2019/01/012019_1642_TSQLPowerQu1.jpg" alt="" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/t-sql-power-query-or-dax/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tableau Prep vs. Power Query</title>
		<link>https://prologika.com/tableau-prep-vs-power-query/</link>
					<comments>https://prologika.com/tableau-prep-vs-power-query/#comments</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Fri, 27 Apr 2018 00:07:25 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Power Query]]></category>
		<category><![CDATA[Tableau]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=5505</guid>

					<description><![CDATA[After a few years of extensive development and beta testing, Tableau announced its data preparation tool (Tableau Prep) for &#8220;redefining your data prep experience&#8221;. Previously, Tableau relied on other vendors, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>After a few years of extensive development and beta testing, Tableau <a href="https://www.tableau.com/about/blog/2018/3/tableau-prep-project-maestro-here-redefining-your-data-prep-experience-84620">announced</a> its data preparation tool (Tableau Prep) for &#8220;redefining your data prep experience&#8221;. Previously, Tableau relied on other vendors, such as Alteryx, for self-service data preparation. Naturally, I wanted to take it for a spin and compare it with the Microsoft Power Query (available for free in Power BI Desktop and Excel), which has been around since January 2013. Power Query was initially introduced as an Excel add-on but now it&#8217;s available in both Excel and Power BI Desktop. For those of you pressed for time, here is the gist:</p>
<div>
<table style="border-collapse: collapse;" border="0">
<colgroup>
<col style="width: 317px;" />
<col style="width: 378px;" />
<col style="width: 402px;" /></colgroup>
<tbody valign="top">
<tr style="height: 25px;">
<td style="padding-left: 7px; padding-right: 7px; border: solid #bfbfbf 0.5pt;"><strong>Criteria</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: solid #bfbfbf 0.5pt; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Power Query</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: solid #bfbfbf 0.5pt; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Tableau Prep</strong></td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Price</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Free</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">$70/user/month for Creator bundle</td>
</tr>
<tr style="height: 23px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Integration</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Integrated with Power BI and Excel</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Stand-alone (with preview in Tableau Desktop)</td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Prepackaged Connectors</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">70</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">26</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Custom Connectors</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Row-level transformations</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Keep rows, remove rows, remove duplicates, promote headers, group by, merge, append, pivot, transpose, combine files</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Pivot, join, union</td>
</tr>
<tr style="height: 124px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Column-level transforms</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Copy, remove, duplicate, column from example, calculated column, remove, remove duplicates, remove errors, change type, rename, transform (lower, upper, trim, etc.), replace values, replace errors, split column, index column, group by, fill, pivot, move, format, extract, number column (statistics, standard, scientific, math), date and time column, R script</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Filter (formula required), group and replace, clean (upper, lower, trim, remove characters), split, rename, remove, calculated field</td>
</tr>
<tr style="height: 22px; background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Interactive graphical step flow</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No (static Query Dependencies diagram)</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Parameters</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Use R for data prep</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>User-created tables</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Detect and expand relationships in data source</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No (one data source at the time)</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Functions (to centralize common logic)</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr style="background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Script (all transformations in one place)</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Yes</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">No</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Calculation language</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><a href="https://msdn.microsoft.com/en-us/query-bi/m/power-query-m-reference">Power Query M language</a></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><a href="http://onlinehelp.tableau.com/current/pro/desktop/en-us/functions.html">Tableau calculation language</a></td>
</tr>
<tr style="height: 25px; background: #f2f2f2;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Output destination</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Directly into PBI data model, Excel sheet (Power Query in Excel only)</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">Save as TDE, Hyper, CSV, preview in Desktop</td>
</tr>
<tr style="height: 46px;">
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: solid #bfbfbf 0.5pt; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;"><strong>Output options</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">One table in the model per query (typically)</td>
<td style="padding-left: 7px; padding-right: 7px; border-top: none; border-left: none; border-bottom: solid #bfbfbf 0.5pt; border-right: solid #bfbfbf 0.5pt;">One output from Tableau Prep file (Tableau model can&#8217;t handle multiple tables)</td>
</tr>
</tbody>
</table>
</div>
<p>It&#8217;s clear that Tableau Prep is far behind the Power Query capabilities and has a lot of catching up to do. I took Tableau Prep for a quick ride to do simple data prep. The goal was to cleanse the geo table in the bi_dimensions Excel file that Microsoft provides as sample data for Dashboard in a Day (DIAD) workshops.</p>
<p><a href="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep1.png" rel="attachment wp-att-5503"><img decoding="async" class="alignnone size-full wp-image-5503" src="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep1.png" alt="042618_2356_TableauPrep1.png" width="391" height="112" srcset="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep1.png 391w, https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep1-300x86.png 300w" sizes="(max-width: 391px) 100vw, 391px" /></a></p>
<p>The geo table has a small (but common) issue because it has some extra rows that appear before the main dataset. These rows needs to be removed and the labels in the forth row needs to be promoted as column headers. Simple right?</p>
<p><a href="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep2.png" rel="attachment wp-att-5504"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5504" src="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep2.png" alt="042618_2356_TableauPrep2.png" width="469" height="145" srcset="https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep2.png 469w, https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep2-450x139.png 450w, https://prologika.com/wp-content/uploads/2018/04/042618_2356_TableauPrep2-300x93.png 300w" sizes="auto, (max-width: 469px) 100vw, 469px" /></a></p>
<p>In Power Query, you can quickly filter out top or bottom rows. No formulas or functions required. There wasn&#8217;t such a feature in Tableau Prep. I had to use a column filter (requires an expression) to filter out the top three rows. So much about &#8220;a drag-and-drop visual experience&#8221; and &#8220;no scripting required&#8221;. I also couldn&#8217;t find a feature to quickly promote column headers. In my opinion, Power Query is by far more user friendly than Tableau Prep.</p>
<p>After enough wrangling to do what&#8217;s simple in Power Query but complicated in Tableau Prep, I wanted to save the results. In Power BI Desktop and Excel, you can conveniently load the transformed data directly into the data model. Then, to reflect the changes in the data source, such as when you get a new file with the same spec, you just refresh to re-import and transform the data. No such integration with Tableau Prep. It&#8217;s designed to run the flow manually. And to me the biggest limitation of the tool, which stems from the limitation in the Tableau modeling capabilities, is that everything falls apart when you need multiple tables in your data model. Tableau&#8217;s mentality remains &#8220;one dataset at the time&#8221;.</p>
<p>I&#8217;ve noticed people excited about the Tableau Prep graphical interface. While it does help visualizing the flow I&#8217;m not sure how much value it really adds given that the steps are sequential, and the tool doesn&#8217;t support conditional constraints and branches. But you have pretty icons…without much behind.</p>
<blockquote><p>While testing the tool, I couldn&#8217;t help but ask myself &#8220;Why pay hundreds of dollars per user/per year for Tableau Creator when Power BI Desktop is better and free?&#8221;</p></blockquote>
<p>I shared more thoughts about Tableau vs Power BI in my blogs <a href="https://prologika.com/power-bi-vs-tableau-part-1/">Power BI vs. Tableau (Part 1)</a>, <a href="https://prologika.com/power-bi-vs-tableau-part-2/">Power BI vs. Tableau (Part 2)</a>, <a href="https://prologika.com/power-bi-vs-tableau-part-3/">Power BI vs. Tableau (Part 3)</a>, and <a href="https://prologika.com/tableau-hyper-vs-power-bi-xvelocity/">Tableau Hyper vs. Power BI xVelocity</a>. As usual, I welcome your comments. Tableau fans are welcome too.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/tableau-prep-vs-power-query/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title>Configuring Power Query OData Feeds</title>
		<link>https://prologika.com/configuring-power-query-odata-feeds/</link>
					<comments>https://prologika.com/configuring-power-query-odata-feeds/#respond</comments>
		
		<dc:creator><![CDATA[Prologika - Teo Lachev]]></dc:creator>
		<pubDate>Thu, 05 Oct 2017 13:46:16 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Power BI]]></category>
		<category><![CDATA[Power Query]]></category>
		<guid isPermaLink="false">https://prologika.com/?p=5155</guid>

					<description><![CDATA[Scenario: A customer has implemented a Power BI model that retrieves data by calling the Dynamics CRM OData Feed endpoint. The dataset refresh operation is timing out. They want to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Scenario:</strong> A customer has implemented a Power BI model that retrieves data by calling the Dynamics CRM OData Feed endpoint. The dataset refresh operation is timing out. They want to increase the timeout setting but unlike connecting to SQL Server, where you can set the timeout duration in the source advanced properties, there is no UI for ODATA.</p>
<p><strong>Solution:</strong> If you open the query behind the table, and click the Source step, you&#8217;ll see in the Query Editor formula bar the following M code:</p>
<p>= OData.Feed(&#8220;https://&lt;tenant&gt;.api.crm.dynamics.com/api/data/v8.1/&#8221;)</p>
<p>From the <a href="https://msdn.microsoft.com/en-US/library/mt260868.aspx">documentation</a>, we realize that OData.Feed can take additional settings and one of them is the Timeout setting that you can pass to the third <em>options</em> argument. For example, you can change the M code to set the timeout to 1 hour:</p>
<p>= OData.Feed(&#8220;https://&lt;tenant&gt;.api.crm.dynamics.com/api/data/v8.1/&#8221;, null, [Timeout=#duration(0,1,0,0)])</p>
<p>The timeout uses the duration data type which is explained <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__msdn.microsoft.com_en-2Dus_library_mt742860.aspx&amp;d=DwMFAg&amp;c=OIyfglD9qG0lRmOy3W5dxw&amp;r=j7lHKQy3JGvGuCwgaCMYQx-EpSaRJ4NhIsQgFqeAPDU&amp;m=IX4ABZZQD--7n8UYRJ6vCkMpPieIP7il09sizIAeqOo&amp;s=G6S9rcIlVdSz87wSjNWnBnv65L2A16vtP3Mvzfs77Mw&amp;e=">here</a>. Bringing this one step further, you can restrict what records get pulled in the OData.Feed using $filter and also only grab data for the columns you&#8217;re using by including the field names in the $select parameters, e.g.</p>
<p>&#8220;https://&lt;tenant&gt;.crm.dynamics.com/api/data/v8.1/leads?$filter=&lt;somefield&gt; eq 740110001&amp;$select= &lt;removed list of fields&gt;&#8221;</p>
<p><img decoding="async" src="https://prologika.com/wp-content/uploads/2017/10/100517_1343_Configuring1.png" alt="" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://prologika.com/configuring-power-query-odata-feeds/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
