<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Musings on Data</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/lukaszp/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/lukaszp/feed.xml</link>
    <description>A blog for data, apis, and all things Power BI by Lukasz Pawlowski.</description>
    <lastBuildDate>Sun, 19 Jun 2016 01:03:00 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>New York Public Library Digital Collection in Power BI</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/new-york-public-library-digital-collection-in-power-bi</link>
      <pubDate>Sun, 19 Jun 2016 01:03:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/?p=605</guid>
      <description><![CDATA[Some time ago I saw news that the New York Public Library has published its digital collection on...]]></description>
      <content:encoded><![CDATA[Some time ago I saw news that the New York Public Library has published its digital collection on its website and as a dataset you could download and explore. So I downloaded it and started to play with it. But as fate had it, I didn't finish the project.

The week before last, I was in New York City for a set of business meetings and I found myself thinking of that data. Since I first downloaded the data, I had also written an <a href="https://app.powerbi.com/visuals/show/ImgViewerVisual1455487926945" target="_blank">Image Viewer visual for Power BI</a> that allows you to view web images in Power BI reports.  So while watching some soccer today I took another crack at finishing my report.

Click through to see an <a href="https://msit.powerbi.com/view?r=eyJrIjoiYjQ3NDhlOWQtMjdjMS00YzkwLTg5MjAtNjhkMjQzMWQzMDYyIiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9" target="_blank">interactive version of the report</a>.

[caption id="attachment_615" align="alignnone" width="850"]<a href="https://msit.powerbi.com/view?r=eyJrIjoiYjQ3NDhlOWQtMjdjMS00YzkwLTg5MjAtNjhkMjQzMWQzMDYyIiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9"><img class=" wp-image-615" src="https://msdnshared.blob.core.windows.net/media/2016/06/NYPL-Screenshot-1024x650.png" alt="See the NYPL digital archive in an interactive  Power BI report" width="850" height="540" /></a> See the NYPL digital archive in an interactive Power BI report[/caption]

&nbsp;

You can <a href="https://1drv.ms/u/s!AgPrV7zj1R9DjL4I6wFFLW5kH6PfyA" target="_blank">download the Power BI desktop file</a>.

You can view the entire <a href="http://digitalcollections.nypl.org/" target="_blank">Digital Archive on the NYPL website</a>.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Working with JSON data in Power BI Desktop's query tab</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/working-with-json-data-in-power-bi-desktops-query-tab</link>
      <pubDate>Sun, 17 Apr 2016 22:51:59 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/?p=585</guid>
      <description><![CDATA[I'm helping some journalists get up to speed with Power BI and walking them through how to load...]]></description>
      <content:encoded><![CDATA[I'm helping some journalists get up to speed with Power BI and walking them through how to load common data sets into Power BI Desktop.  A recurring topic of interest is how to load government data, including unemployment rate. Here's a report I created to show what you can make with Power BI, <a href="https://msit.powerbi.com/view?r=eyJrIjoiNjA2MzFiNmQtODUwNS00MTJmLWI0ZWMtNDE3NWRiMDMwYzU4IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9">click through to see it</a>.

<a href="https://msit.powerbi.com/view?r=eyJrIjoiNjA2MzFiNmQtODUwNS00MTJmLWI0ZWMtNDE3NWRiMDMwYzU4IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9"><img class="alignnone  wp-image-586" src="https://msdnshared.blob.core.windows.net/media/2016/04/Unemployment-rate-Short-Term-1024x596.png" alt="Click through to view this report" width="861" height="501" /></a>

&nbsp;

While there are many sources to choose from, commonly this data is available using a URL which downloads the data in JSON format. If you're a journalist or analyst needing to repeat your analysis over and over, you'll save time - no more manually downloading CSV or Excel files. Sometimes you're lucky - the JSON data is 'flat' or flat enough that you can use building pivot, unpivot, expand column, and other built-in transforms to wrangle the JSON into shape.

&nbsp;

<strong>But what if the JSON data is not 'flat'</strong>

Here's what I'm talking about. I have a JSON file with some metadata, a list of columns and a list of data.  Now what?

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/2016-04-16-13.png"><img class="alignnone  wp-image-595" src="https://msdnshared.blob.core.windows.net/media/2016/04/2016-04-16-13-1024x647.png" alt="2016-04-16 (13)" width="855" height="541" /></a>

&nbsp;

Well the query tab in Power BI has what it takes to make quick work of this JSON input. Here's how.... but <a href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!231654&amp;authkey=!AI4FW9OIEnmq9O4&amp;ithint=file%2cpbix">first download the example to see the whole thing</a>. You'll need to get an API Key from <a href="https://www.quandl.com/">Quandl</a> to see the queries in action.

&nbsp;

<strong>Start by divide and conquer </strong>

I load the data using the web source under "Get Data". I split out the 3 components (metadata, columns list, data list) into separate queries using the 'reference' option on the right-click the query.  I do that for each of the components. Then I tune each of the resulting queries to do what I need it to do.
<blockquote><strong>Pro Tip</strong>: In the Query tab, you can change whether the data loads to the data model or not by unchecking the 'enable load' option on the right-click menu for a query. It's super useful, give it a try.</blockquote>
&nbsp;

<strong>Looking up column names</strong>

Notice that I kept the ColumnsList query as a 'list' that shows the column names, you'll see how I use that in a minute. When I expand the 'Data' query, I just get a single column with values, but they're all jumbled - I can't tell yet which value is from which column.  To solve that I follow a pattern you should know.

First I add calculated columns in the Query window as follows:
<blockquote>Table.AddIndexColumn(#"Expanded Column1", "Index", 0, 1)

ColumnIndex = Number.Mod([Index], List.Count(ColumnsList))

Column Name = ColumnsList{[ColumnIndex]}</blockquote>
The first column I created using the "Add Index Column" option on the "Add Column" ribbon. For the others, I use the "Add Custom Column" option in the same ribbon.

&nbsp;

<strong>So how does that work?</strong>

Queries in the Query tab can refer to each other.  So you can see that two of my custom columns refer to the ColumnsList query.  The first uses the number of values in the ColumnsList query to provide the index of the column name from that list using the handy Number.Mod function.  Mod is really useful, it's a good trick to have up your sleeve.  Then I get the column name by getting the column name from the ColumnsList by reference.  The {} let me index into any list in the query tab. That's another good trick.

&nbsp;

<strong>From column names to regular columns</strong>

Second, I use another pattern to get the values into columns with correct labels.
<blockquote>Date = if([Attribute] = "DATE") then [Value] else null

Value.1 =  if([Attribute] = "VALUE") then  [Value] else null

Fill Down on Date

Filter out nulls on Value.1</blockquote>
Now I have a dataset I can plot easily in Power BI, so I'm done. Time to close and load!

&nbsp;

<strong>Where this works, and where it breaks down</strong>

For a small number of columns, this approach works great. As the number of columns increases you'll need to repeat the pattern for each of the columns.  For 10 or more columns, it gets tedious, but doable. 100 columns... well I might search harder for an alternate data source. However, there's a silver lining: if you're reporting on or analyzing this kind of data often, you'll be building a library of 'go-to' Power BI Desktop files you can refresh at a moments notice to get the data you need.

-Lukasz

<a href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!231654&amp;authkey=!AI4FW9OIEnmq9O4&amp;ithint=file%2cpbix">Download the example Power BI Desktop file</a>]]></content:encoded>
    </item>
    <item>
      <title>Basic DAX filtering with CALCULATE and ALL functions</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/basic-dax-filtering-with-calculate-and-all-functions</link>
      <pubDate>Sat, 09 Apr 2016 21:49:11 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/?p=543</guid>
      <description><![CDATA[Recently I helped a few reporters get their first taste of building reports using Power BI. Power BI...]]></description>
      <content:encoded><![CDATA[Recently I helped a few reporters get their first taste of building reports using Power BI. Power BI provides sophisticated filters and expressions that help you get the most of your data. In this post I'll focus a little on the expressions you can use to create custom calculations in Power BI. The expressions are defined in a language called DAX. Learning to use DAX is not hard, but can be overwhelming for the first timer. I'm hoping to show you in this blog post a few basics to help you get started with DAX measures.

Let's start with an example report.  <a href="https://msit.powerbi.com/view?r=eyJrIjoiMjllMjgwNTEtNjMzYy00MTFiLWIzZTUtYzA3MDU5ODYwODE4IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9">Click through </a>to see the interactive version.

<a href="https://msit.powerbi.com/view?r=eyJrIjoiMjllMjgwNTEtNjMzYy00MTFiLWIzZTUtYzA3MDU5ODYwODE4IiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9"><img class="alignnone  wp-image-553" src="https://msdnshared.blob.core.windows.net/media/2016/04/basics-of-dax-filtering-using-measures-image-1024x588.png" alt="basics of dax filtering using measures image" width="744" height="427" /></a>

&nbsp;

The data in this example is pretty basic, consisting of a single table with to categorical fields and one value field.  As you interact with the report, notice that some parts for the report cross filter/highlight (usually this is called 'brushing' by the visualization community).  Other parts don't change.  Power BI let you control this using two core features.

The first feature is called Edit Visual Interactions. This lets you choose which visuals filter other visuals.  I'm using it in this example so the slicer and the column chart do not filter the table on the left.  This is easy to do using the option in the ribbon.

The second feature is called Measures. Measures are expressions that calculate values on the fly.  Measures are specified using DAX, an Excel like formula language. DAX lets you customize your calculations by selecting exactly which rows of data are included in the calculation.

Let's work through how the "SUM" of "Value" is calculated by Power BI. At first it's pretty simple - you just add all the instance values in the table of data.  So SUM of the 9 rows in the example is 35831. When a user selects a category like "Cars", the table of data is filtered to show only the 3 rows and gives a total of 12000.

This makes sense and is pretty easy to do. Now sometimes you want to compare a filtered value to the overall total. So how can you get the unfiltered value while still allowing the user to select various data points within the report.  This is where DAX measures come in.

Here's one of the example measures:
<blockquote>GrandTotal = CALCULATE(SUM('Demo Data'[Value]), ALL('Demo Data'[Category]))</blockquote>
&nbsp;

In the example I'm using a DAX function called CALCULATE to create three measures.  The CALCULATE function takes an aggregate function and a filter context.  The aggregate functions I'm using in the example are SUM, MIN, and MAX. I specify which field I want to aggregate, specifically the 'Value' column. This is clear and easy.

The filter context is a little harder to understand. The filter expression I'm using is the ALL() filter.  ALL just clears the filter context on the specified table or field and applies a different filter.  This can be counter intuitive until you remember that when a user is clicking on data points in Power BI various filters are being applied to the underlying tables, which affects the calculations.  So you can either add additional filters or remove filters so you can apply different ones. This is probably the hardest concept to understand when using DAX. Once you get it, you're golden.

The specific filter I'm using is <b>ALL('Demo Data'[Category])</b>. I'm using this to clear any filters applied to the Category field in the 'Demo Data' table. Notice that I'm not clearing all filters, just the ones on the specific field.  In the example, if you use the slicer to select from 'Cars', 'Planes', or 'Trains', the totals at the bottom of the report do not change. However, if you select data points on the columns chart, the totals at the bottom of the report do change. This is because the measures I defined only clear the filters on the Category field, not all filters on the Demo Data table. This allows me to clearly define how my calculations are made and help me get the right answer to my questions.

This example is pretty simple, there's much more than you can do with measures. To get the most from Power BI, learning and practicing how to control filter context with measures will help you find insights and amaze your colleagues.

-Lukasz

<a title="Power BI Report Example" href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!229145&amp;authkey=!AFr1r_A2C8Uhsng&amp;ithint=file%2cpbix" target="_blank">Download the Power BI Report from this example</a>

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>#VisualizeChange - Comments in Words</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/visualizechange-comments-in-words</link>
      <pubDate>Tue, 25 Aug 2015 20:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/08/25/visualizechange-comments-in-words/</guid>
      <description><![CDATA[Recently a retweet from @olivier_matrat&nbsp;&nbsp;came through my twitter feed and it struck a...]]></description>
      <content:encoded><![CDATA[<p>Recently a retweet from <a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/olivier_matrat">@<span class="u-linkComplex-target">olivier_matrat</span></a>&nbsp;&nbsp;came through my twitter feed and it struck a chord. It was the <a href="https://unite.un.org/ideas/content/visualizechange">#VisualizeChange</a>&nbsp; challenge part of this year's <a href="https://www.worldhumanitariansummit.org/" rel="nofollow"><span style="color: #3090c7;">World Humanitarian Summit.</span></a>&nbsp;&nbsp;Submissions are due&nbsp;8/31, so there's still time for folks to work on it. Not sure if I'll actually enter into the contest, but I did do enough work on it to produce the below, hope you like it.&nbsp;</p>
<p>I also did some work to build an excel workbook that translates the raw table of data provided for the competition into something more usable. If you'd like to use the workbook, I've provided a link below where you can download it.&nbsp;To use it, you'll either need Excel 2013 with Power Query or <a href="https://powerbi.microsoft.com/desktop">Power BI Desktop</a> (free)&nbsp;to pull in the data, or other tools that can read Excel files.</p>
<p>You can see it more <a href="https://docs.com/lukasz-pawlowsk/2060/visualizechange-in-words">interactively on Docs.com here</a>.</p>
<div style="width: 600px; max-width: 100%; margin-bottom: 5px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/5153.wordsofvisualizechange.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/5153.wordsofvisualizechange.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/5153.wordsofvisualizechange.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/5153.wordsofvisualizechange.png" alt="" border="0" /></a></div>
<p>The treemap above shows a count of the occurrence of words in the contest data set. It's interesting to see what words are used to see what concepts or ideas are really important to the people making comments. To do that I used Power Query with various unpivot and split transforms to get to a table of words. &nbsp;I then asked Power BI Desktop to plot the count of words a a treemap. &nbsp;If you look at the excel file I mention below, you'll have tables of distinct words, distinct comments, and distinct documents. &nbsp;So you can take this approach much further. &nbsp;I'm toying with some basic heuristics to find 'meaningful' words for example and that's looking promising.&nbsp;</p>
<div style="width: 600px; max-width: 100%; margin-bottom: 5px;"><strong>Resources:</strong></div>
<p><a href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!165656&amp;authkey=!AJ_KWI1LodNd98o&amp;ithint=folder%2cxlsx">Files on OneDrive</a>, you'll want to grab a copy of <strong>[Master Data] WHS Master Consultation Data Collection (23 July 2015).xlsx</strong> at least.&nbsp;</p>
<p>&nbsp;</p>
<p>If I end up making a contest submission, I'll post my entire submission, including the Power BI Desktop file as well so you can play with it.</p>
<p>HTH,</p>
<p>Lukasz</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Visualizing London's open data in Power BI</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/visualizing-londons-open-data-in-power-bi</link>
      <pubDate>Sat, 08 Aug 2015 09:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/08/08/visualizing-londons-open-data-in-power-bi/</guid>
      <description><![CDATA[Today we're visiting London, UK. &nbsp;In previous posts, I've looked at data from Seattle and...]]></description>
      <content:encoded><![CDATA[<p>Today we're visiting London, UK. &nbsp;In previous posts, I've looked at data from <a href="http://blogs.msdn.com/b/lukaszp/archive/2015/02/22/seattle-building-permits-visualized-in-power-bi-with-socrata-odata-and-data-seattle-gov.aspx">Seattle </a>and <a href="http://blogs.msdn.com/b/lukaszp/archive/2015/04/26/visualizing-city-of-chicago-owned-properties-with-power-bi-designer.aspx">Chicago</a>. &nbsp;Now we're headed across the pond to see data from the UK. &nbsp;Specifically, the Greater London Authority has a myriad of data available at <a href="http://data.london.gov.uk">London Datastore</a>. &nbsp;The datasets are generally covered by the&nbsp;<span class="dp-licence-text"><a href="http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/">UK Open Government Licence (OGL)</a>&nbsp;</span>but some have specific attributions and licenses requirements. So, lets get this out of the way - the data used in this blog post "Contains public sector information licensed under the Open Government Licence v2.0."</p>
<p>This treasure trove of information invites a lot of visualizations. &nbsp;But where should I begin? &nbsp;</p>
<p>Glad you asked! &nbsp;Turns out there's a catalog of all the data feeds available from the City of London in a handy CSV format. The data set has a really good set of attributes including direct links to datasets, attributions, etc. &nbsp;While there is a <a href="http://data.london.gov.uk/dataset">search feature</a>&nbsp;on the website, it's somehow not as interactive as I'd like. &nbsp;So let's take a look at how we can sift through London's datasets using Power BI Desktop. &nbsp;</p>
<p><strong>Resources</strong></p>
<p><a href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!164391&amp;authkey=!AGLgruMMsLhzHjU&amp;ithint=file%2cpbix">Download: &nbsp;London Data Feeds Index.pbix</a></p>
<p><a href="https://powerbi.microsoft.com/desktop">Download: &nbsp;Power BI Desktop</a> if you don't already have it</p>
<p><a href="http://data.london.gov.uk/dataset/london-datastore-catalogue">Download: &nbsp;the London Datastore Catalogue CSV file</a> &nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;</p>
<p><strong>More data, updated more often</strong></p>
<p>I started by looking just to see how many data sets London publishes and how that has changed over time. &nbsp;Here's a great view that shows London is publishing or updating more data sets today than a year ago. &nbsp;You can see there are 602 datasets we could analyze - a cornucopia of data! &nbsp;You can see that the number of data sets updated in 2015 is already on pace to exceed 2014. &nbsp;So not only is London publishing data, but it's keeping the data updated as the months go by.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/5722.london%20data%20-%20data%20feed%20updates.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/5722.london-data-_2D00_-data-feed-updates.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/5722.london%20data%20-%20data%20feed%20updates.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/5722.london-data-_2D00_-data-feed-updates.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Loading the data</strong></p>
<p>Loading the CSV file is very easy in Power BI Desktop. &nbsp;I just clicked Get Data and selected CSV. &nbsp;The basic CSV was loaded correctly with all the data types correctly detected. &nbsp;There were a few things I spotted that I wanted to do to make the data more useful. &nbsp;To start there's a URL field - I want it to be clickable when used in the report so I changed the Data Category for the URL field to "Web URL". &nbsp; Then there's the tag field. &nbsp;Its a single comma separated field and I wanted to see which were the popular tags. &nbsp;To do this, I needed first to isolate each tag value and then ensure I could slice and dice the data feeds based on the tags. &nbsp;Getting there required two additional tables. &nbsp;The first provided the unique tag values. The second related the tags to the IDs. &nbsp;You'll see in the Power BI Desktop file, I created relationships across the detail table and the two new tables to ensure I could filter the values. Importantly, I used the ID column from the IdToTagsMap table in the main table for tags to force the use of the relationships during filtering. &nbsp;You can see why this is needed in the image below, where the IdToTagsMap table is on the 'many' side of the relationships from the Datasets and Tags tables.&nbsp;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/1854.london%20data%20-%20relationships.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/1854.london-data-_2D00_-relationships.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/1854.london%20data%20-%20relationships.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/1854.london-data-_2D00_-relationships.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong>A searchable index of London datasets</strong></p>
<p>When you have so many datasets, it's hard to find all of them. So the sheet below shows how I created an interactive index of all the datasets published for London. &nbsp;You can filter on Topics, by Tag, or the update frequency. &nbsp;Since it's an interactive sheet, you can use any of the Fields to build additional filters or modify the visualizations. &nbsp;One thing I immediately noticed is there's a ton of 'tags'. &nbsp;Many datasets have unique tag values that actually are compound name that include other tags in a single long string. &nbsp;So I filtered out the tags with few datasets. &nbsp;I set the filter on the tags visualization so I could show all the datasets in the other charts. &nbsp;This single view would make any student doing homework and looking for data from London really happy.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/7701.london%20data%20-%20index.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/7701.london-data-_2D00_-index.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/7701.london%20data%20-%20index.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/7701.london-data-_2D00_-index.png" alt="" border="0" /></a>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Drilling into Topics and Publishers</strong></p>
<p>The view below shows the top topics by number of datasets. &nbsp;You can clearly see where the UK government and the City of London are spending their 'data dollars' err.. 'data pounds' :). &nbsp;It's clear to see that normal topics like demographics, employment and skills, environment, transport are of primary importance. &nbsp;But the 'transparency' topic is an interesting find. &nbsp;Should be a useful area for citizens to dive into. &nbsp; You can also see that the 3 biggest publishers, by number of datasets, are the Greater London Authority (GLA), Office of National Statistics (ONS), and Transport for London (TfL).&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/6507.london%20data%20-%20topics.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/6507.london-data-_2D00_-topics.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/6507.london%20data%20-%20topics.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/6507.london-data-_2D00_-topics.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Slicing and Dicing&nbsp;</strong></p>
<p>I built the view below to help me understand the datasets more. &nbsp;I can clearly see which data sets apply to which geographic area - I especially liked the 'smallest geography' attribute since it makes finding relevant data very easy. The 'bounding box' attribute was similar so you can understand the applicability of the dataset at a glance. &nbsp; Lastly, the 'date from' and 'date to' attributes help you find interesting historical reference data. &nbsp;For example, one of the data sets, <a href="http://data.london.gov.uk/dataset/global-city-population-estimates">Global City Population Estimates</a>,&nbsp;&nbsp;goes all the way back to January of 1950! &nbsp;It might be the subject of a future blog post.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/7450.london%20data%20-%20slices.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/7450.london-data-_2D00_-slices.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/7450.london%20data%20-%20slices.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/7450.london-data-_2D00_-slices.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Wrapping up</strong></p>
<p>Building the initial index of London datasets was accomplished in a couple of minutes. &nbsp;I was able to slice and dice quickly. &nbsp;Once I got into features like analyzing by tag I had to put a little more work into it, mostly because I don't do that kind of thing very often. &nbsp;It was simple to do using the built-in UI. &nbsp;Having this index, that is easily accessible, searchable, and filterable with drill through to each of the pages hosting the data feeds is remarkably useful I think. &nbsp;Would really like to hear from other folks who have compiled data sets like this one.&nbsp;</p>
<p>&nbsp;</p>
<p>HTH,&nbsp;</p>
<p>-Lukasz</p>]]></content:encoded>
    </item>
    <item>
      <title>Finding the Latest Date in Power BI Desktop</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/finding-the-latest-date-in-power-bi-desktop</link>
      <pubDate>Sat, 08 Aug 2015 08:47:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/08/08/finding-the-latest-date-in-power-bi-desktop/</guid>
      <description><![CDATA[One common question I get is how to do date filtering in Power BI.&nbsp; In a previous post, I...]]></description>
      <content:encoded><![CDATA[<p>One common question I get is how to do date filtering in Power BI.&nbsp; In a <a href="http://blogs.msdn.com/b/lukaszp/archive/2015/03/05/power-bi-date-filtering.aspx">previous post</a>, I showed how to make filters that show if a values occurred in the last 30 days, in the last month, in the last 12 months, or in the current year.&nbsp;</p>
<p>This post show how to show the latest date.&nbsp; You can read on below, or grab the <a href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!164348&amp;authkey=!AAjt8w6w0zlf_20&amp;ithint=file%2cxlsx">data</a> and <a title="MaxDateExample.pbix" href="https://onedrive.live.com/redir?resid=431FD5E3BC57EB03!164349&amp;authkey=!AElnOM_3Q95UsHE&amp;ithint=file%2cpbix">MaxDateExample.pbix</a> files to see it in action yourself.&nbsp; If you don't have Power BI Desktop yet, you can get it <a href="https://powerbi.microsoft.com/desktop">here</a>.</p>
<p><strong></strong>&nbsp;</p>
<p><strong>Step 1: Import your data set.</strong></p>
<p>In this case I have a simple table called Table1 with a column called Date.&nbsp; Just click Get Data and select the excel workbooks (Book1.xlsx). &nbsp;Select Table1 and press the Load button. The data will load and you'll see fields at right on the screen; you can drag them to the canvas to create a table or chart.</p>
<p>&nbsp;</p>
<p><strong>Step 2: Create a measure to return the Latest Date</strong></p>
<p>Select the table in the fields list and press the 'New Measure' button in the ribbon. Here's the formula to use:</p>
<p>MaxDate = CALCULATE(MAX(Table1[Date]), ALL(Table1))</p>
<p>I wanted to mention why I'm using CALCULATE.&nbsp; In Power BI, every time you use data, it is implicitly grouped by the categories that are used.&nbsp; A measure when used in a group context, computes its value only within that group by default.&nbsp; This makes sense when trying to make measures that work at any level of grouping/hierarchy.&nbsp; In my "latest' case, I want to get the latest value regardless of grouping.&nbsp; To do that I'm using the CALCULATE (... , ALL(...)) pattern.&nbsp; It's a little confusing since the ALL(...) is called a 'filter' but it's working on grouping... yikes. You can think of a group as a kind of filter that select only rows that match the group label... so it all works out.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/0550.maxdate1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/0550.maxdate1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/0550.maxdate1.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/0550.maxdate1.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong>Step 3: Add a column to the table that tells you which rows have the latest date</strong></p>
<p>Select the table in the files list and press the "New Column" button in the ribbon.&nbsp; Here's the formula to use:</p>
<p>Is Latest = if(Table1[Date] = Table1[MaxDate], "Latest", "")</p>
<p>This checks if the value of the "Date" column in each row exactly matches the MaxDate value computed for all rows and writes the value "Latest" if it does.&nbsp; Note that if you're using date time, this includes hours, minutes, seconds in the calculation; if you just want to know if it's on a specific day, then you'd adjust the formula.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/3554.maxdate2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/3554.maxdate2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/3554.maxdate2.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/3554.maxdate2.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p><strong>Step 4: Use the "Is Latest" column in filters or slicers </strong></p>
<p>You can now drag the "Is Latest" column to the filter area at the visualization or page level to show the value you want.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/8154.maxdate3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/8154.maxdate3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/8154.maxdate3.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/8154.maxdate3.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>As a bonus, Power BI now support adding date and text measures to the canvas, so you can even put MaxDate in your report without jumping through hoops.&nbsp; This is useful if you'd like to show the "last updated time" for your queries.</p>
<p>&nbsp;</p>
<p>HTH,</p>
<p>-Lukasz</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Don't miss out -  See Power BI in action at the Ignite Expo Hall</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/dont-miss-out-see-power-bi-in-action-at-the-ignite-expo-hall</link>
      <pubDate>Sun, 03 May 2015 18:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/05/03/dont-miss-out-see-power-bi-in-action-at-the-ignite-expo-hall/</guid>
      <description><![CDATA[&nbsp;
Folks,
Spread the word.&nbsp; Dawn, our amazing event coordinator, has put together an...]]></description>
      <content:encoded><![CDATA[<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/1106.ignite%20banner.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/1106.ignite-banner.png"><img style="width: 586px; height: 49px;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/1106.ignite%20banner.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/1106.ignite-banner.png" alt="" width="551" height="49" border="0" /></a></p>
<p>&nbsp;</p>
<p>Folks,</p>
<p>Spread the word.&nbsp; Dawn, our amazing event coordinator, has put together an 'A' list of quick demos to help you get up to speed on Power BI.&nbsp; Here's the list of presenters so far.&nbsp; Please tweet, share, repeat, tell your friends, and be sure to stop by to see these great sessions.&nbsp; &nbsp;</p>
<p>You'll find us in front of the large touch screen PPI under the blue Cloud sign.&nbsp; Can't wait!</p>
<table style="width: 558px;" border="0" cellspacing="0" cellpadding="0"><colgroup><col width="76" /></colgroup><colgroup><col width="64" /></colgroup><colgroup><col width="313" /></colgroup><colgroup><col width="105" /></colgroup>
<tbody>
<tr>
<td width="76" height="20">Day</td>
<td width="64">Time</td>
<td width="313">Demo Title</td>
<td width="105">Presenter</td>
</tr>
<tr>
<td height="20">Mon, 4th</td>
<td>12:00pm</td>
<td>5 minutes to wow, Power BI demo</td>
<td width="105">Sanjay Soni</td>
</tr>
<tr>
<td height="20">Mon, 4th</td>
<td>12:30pm</td>
<td>How I bought a car with the help of Power BI&nbsp;</td>
<td width="105">Lukasz Pawlowski&nbsp;</td>
</tr>
<tr>
<td height="20">Mon, 4th</td>
<td>1:00pm</td>
<td>You'll be surprised with this topic, and so will we :)</td>
<td width="105">TBD</td>
</tr>
<tr>
<td height="20">Mon, 4th</td>
<td>6:15pm</td>
<td>Datazen Mobile Business Intelligence with SQL Server</td>
<td width="105">Dean Ivankovich&nbsp;</td>
</tr>
<tr>
<td height="20">Mon, 4th</td>
<td>6:45pm</td>
<td>Power BI Dashboards from scratch in 5 minutes</td>
<td width="105">Sanjay Soni</td>
</tr>
<tr>
<td height="32">Mon, 4th</td>
<td>7:15pm</td>
<td>Predictive Maintenance Demo</td>
<td width="105">Seayoung Rhee, <br /> Sonia Carlson</td>
</tr>
<tr>
<td height="20">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td height="20">Tue, 5th</td>
<td>12:00pm</td>
<td>Real time Dashboards demo</td>
<td width="105">Sanjay Soni</td>
</tr>
<tr>
<td height="32">Tue, 5th</td>
<td>12:30pm</td>
<td>Predictive Maintenance Demo</td>
<td width="105">Seayoung Rhee, <br /> Sonia Carlson</td>
</tr>
<tr>
<td height="20">Tue, 5th</td>
<td>1:00pm</td>
<td>SQL time with Scott</td>
<td width="105">Scott Klein</td>
</tr>
<tr>
<td height="20">Tue, 5th</td>
<td>4:30pm</td>
<td>Datazen Mobile Business Intelligence with SQL Server</td>
<td width="105">Dean Ivankovich&nbsp;</td>
</tr>
<tr>
<td height="20">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td height="20">Wed, 6th</td>
<td>12:00pm</td>
<td>End to end business analytics demo</td>
<td width="105">Sanjay Soni</td>
</tr>
<tr>
<td height="32">Wed, 6th</td>
<td>12:30pm</td>
<td>Predictive Maintenance Demo</td>
<td width="105">Seayoung Rhee, <br /> Sonia Carlson</td>
</tr>
<tr>
<td height="20">Wed, 6th</td>
<td>1:00pm</td>
<td>Datazen Mobile Business Intelligence with SQL Server</td>
<td width="105">Dean Ivankovich&nbsp;</td>
</tr>
<tr>
<td height="20">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="105">&nbsp;</td>
</tr>
<tr>
<td height="20">Thu, 7th</td>
<td>11:30pm</td>
<td>Power half-n-hour</td>
<td width="105">Matt Masson</td>
</tr>
<tr>
<td height="20">Thu, 7th</td>
<td>12:00pm</td>
<td>Machine learning and Power BI demo</td>
<td width="105">Sanjay Soni</td>
</tr>
<tr>
<td height="20">Thu, 7th</td>
<td>12:30pm</td>
<td>SQL time with Scott</td>
<td width="105">Scott Klein</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>See you there.&nbsp; Of course I'll feature my talk in more depth right here on my blog as well.</p>
<p>-Lukasz</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Visualizing City of Chicago owned properties with Power BI Designer</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/visualizing-city-of-chicago-owned-properties-with-power-bi-designer</link>
      <pubDate>Sun, 26 Apr 2015 12:04:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/04/26/visualizing-city-of-chicago-owned-properties-with-power-bi-designer/</guid>
      <description><![CDATA[Update 8.9.2015: Title updated with new product name
&nbsp;
The week after next, I&rsquo;ll be in...]]></description>
      <content:encoded><![CDATA[<p><em>Update 8.9.2015: Title updated with new product name</em></p>
<p>&nbsp;</p>
<p>The week after next, I&rsquo;ll be in Chicago to present at Microsoft&rsquo;s Ignite conference.&nbsp; I thought it would be fun to look at some data for the City of Chicago to see what I could do with it. &nbsp;</p>
<p>Revenue is important to any city.&nbsp; Developing enduring sources of revenue, whether through direct means like leasing city owned property or other ingenious ideas, is something every city planner needs to consider when thinking about where to spend precious resources.&nbsp; Let&rsquo;s see how the City of Chicago Data Portal (<a title="https://data.cityofchicago.org/" href="https://data.cityofchicago.org/">https://data.cityofchicago.org/</a>) helps us.&nbsp; I&rsquo;ll use Microsoft&rsquo;s Power BI Designer to do the analysis (<a href="https://powerbi.com/dashboards/downloads/">free download</a>).</p>
<p>Before I get too far into it, a word of caution: While the data and tools used are real, without more analysis no conclusions should be drawn as to what actions to take.&nbsp; I&rsquo;m not sure what the facts on the ground are in Chicago or any of the neighborhoods mentioned below.&nbsp; Maybe someone&rsquo;s already thinking about all of this.&nbsp; In any case, let&rsquo;s see what the numbers say&hellip;</p>
<p>I opened the <a href="https://data.cityofchicago.org/">City of Chicago Data Portal</a> and found the &ldquo;<a href="https://data.cityofchicago.org/Community-Economic-Development/City-Owned-Land-Inventory/aksk-kvfp">City-Owned Land Inventory</a>&rdquo; data set.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/1588.cblog1_43A5D544.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/1588.cblog1_5F00_43A5D544.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6874.cblog1_thumb_0135C3BF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6874.cblog1_5F00_thumb_5F00_0135C3BF.png" alt="cblog1" width="554" height="366" border="0" /></a></p>
<p>As with any <a href="http://www.socrata.com/" target="_blank">Socrata</a> based data portals, you can get an OData url as shown below that makes it really easy to get the data into Power BI Designer.&nbsp; Power BI Designer natively supports OData input so the data loads quickly and easily.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7776.cblog2_67CDC084.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7776.cblog2_5F00_67CDC084.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6712.cblog2_thumb_5C380345.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6712.cblog2_5F00_thumb_5F00_5C380345.png" alt="cblog2" width="554" height="297" border="0" /></a></p>
<p>&nbsp;</p>
<p>Now to do the mashup, I needed to get a sense of the rental rates in the City of Chicago.&nbsp; So I looked around the web and found <a href="http://www.loopnet.com">http://www.loopnet.com</a>.&nbsp; They have a set of tables that show various <a href="http://www.loopnet.com/Chicago_Illinois_Market-Trends">real estate market trends in Chicago</a>, including lease rates.&nbsp; There are a lot of different trends to choose from. I somewhat arbitrarily chose the Office Property Asking Rent &ndash; Lease Trends and chose the &ldquo;Metro&rdquo; rate for the analysis.&nbsp; I wanted to use a nice representative number.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6305.cblog3_10D85F81.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6305.cblog3_5F00_10D85F81.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7220.cblog3_thumb_4983098E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7220.cblog3_5F00_thumb_5F00_4983098E.png" alt="cblog3" width="554" height="325" border="0" /></a></p>
<p>To get this data into Power BI Designer, I used the option Home-&gt;Get Data-&gt; Web and entered the URL &ldquo;<a href="http://www.loopnet.com/Chicago_Illinois_Market-Trends">http://www.loopnet.com/Chicago_Illinois_Market-Trends</a>&rdquo;.&nbsp; I picker that opens has a bunch of tables in it and allows me to preview tables.&nbsp; Some guess and check iteration is required, but eventually I found Table 28 is the one I wanted.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7356.cblog4_4D0F7B50.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7356.cblog4_5F00_4D0F7B50.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6786.cblog4_thumb_3080E055.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6786.cblog4_5F00_thumb_5F00_3080E055.png" alt="cblog4" width="554" height="442" border="0" /></a></p>
<p>I called this table &ldquo;RentalRates&rdquo;. Now that I had reasonable rental rates, I could really get going with my mashup.&nbsp; To figure out the &ldquo;Potential Revenue&rdquo; for each property I needed to multiply the square feet of the property by the rental rate.&nbsp; This required some Power Query know how.&nbsp;</p>
<p>I added a custom column called &ldquo;Potential Revenue&rdquo; to the &ldquo;City Owned Properties&rdquo; query.&nbsp;&nbsp; The column does a look up in the RentalRates table for the rental rate for &ldquo;Metro&rdquo; which is what I wanted to use.&nbsp;</p>
<h3>Some technical details&hellip;</h3>
<p><strong>If you don&rsquo;t care about technical details, skip down to the pictures below!</strong> But this little bit of exposition shows a couple of Power Query tips and tricks you might want to have in your tool belt.</p>
<p>Here&rsquo;s what the &ldquo;Potential Revenue&rdquo; column&rsquo;s formula looks like:</p>
<p>[sq_ft] * <br />Table.SelectColumns( <br />&nbsp;&nbsp;&nbsp; Table.SelectRows(RentalRates, each ([Region] = "-Metro")) <br />&nbsp;&nbsp;&nbsp; , {"$/sqft (Mar 15)"} <br />){0}[#"$/sqft (Mar 15)"]</p>
<p>Let&rsquo;s step through what this does.&nbsp; You need to read it from the inside out.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; Table.SelectRows(RentalRates, each ([Region] = "-Metro"))</p>
<p>This selects a row in the &ldquo;RentalRates&rdquo; table where the column &ldquo;Region&rdquo; has the text &ldquo;-Metro&rdquo; in it.&nbsp; You might ask why I chose that string, it&rsquo;s by inspection of the data value returned from the web page.&nbsp; I could have cleaned it a little, but that&rsquo;s for next time.</p>
<p>Next we have the Table.SelectColumns that selects the column I want.&nbsp; That column as the name &ldquo;$/sqft (Mar 15)&rdquo;</p>
<p>Table.SelectColumns( <br />&nbsp;&nbsp;&nbsp; Table.SelectRows(RentalRates, each ([Region] = "-Metro")) <br />&nbsp;&nbsp;&nbsp; , {"$/sqft (Mar 15)"} <br />)</p>
<p>Now comes the tricky part.&nbsp; What the above returns is a table with one column name &ldquo;$/sqft (Mar 15)&rdquo; with one row, and in that row is the value I want. So I can append the power query row indexer {0} to get the first row of the table and specify the power query column indexer [#"$/sqft (Mar 15)"] to get the value of the column named &ldquo;$/sqft (Mar 15)&rdquo;.&nbsp; Notice the # sign.&nbsp; What that does is it makes string an object that the system can compare against the column.</p>
<p>{0}[#"$/sqft (Mar 15)"]</p>
<p>Whew &ndash; so am I really crazy smart at Power Query to get this done? No not really.&nbsp; The way I build that was using a trick.&nbsp; In the queries list, I right clicked the RentalRates query and selected &ldquo;reference&rdquo;.&nbsp; This creates a &ldquo;RentalRates (2)&rdquo; query that I can use the Power Query UI to filter to the right row and select the right column. Then I could select the cell I wanted, right click and select &ldquo;Drill Down&rdquo; this gives the following query.&nbsp; Btw, on the &ldquo;View&rdquo; tab you can use the &ldquo;Advanced Editor&rdquo; to see and edit the queries.</p>
<p>let <br />&nbsp;&nbsp;&nbsp; Source = RentalRates, <br />&nbsp;&nbsp;&nbsp; #"Filtered Rows" = Table.SelectRows(Source, each ([Region] = "-Metro")), <br />&nbsp;&nbsp;&nbsp; #"Removed Other Columns" = Table.SelectColumns(#"Filtered Rows",{"$/sqft (Mar 15)"}), <br />&nbsp;&nbsp;&nbsp; #"$/sqft (Mar 15)" = #"Removed Other Columns"{0}[#"$/sqft (Mar 15)"] <br />in <br />&nbsp;&nbsp;&nbsp; #"$/sqft (Mar 15)"</p>
<p>With this query, I can easily get to the expression I used.&nbsp; Now I did it that way because I was curious about indexing in in Power Query (I need to know all that for my day job).&nbsp;</p>
<p><strong>There&rsquo;s an easier way to do it, that probably few people know about!&nbsp; </strong>For analysts, instead of using &ldquo;Drill Down&rdquo;, I probably would recommend selecting &ldquo;Add as New Query&rdquo; on the drop down.&nbsp; This makes a new query that returns the value of the cell you selected.&nbsp; By default this gives a query with the name of the column.&nbsp; After renaming the query to something like &ldquo;metroRentalRate&rdquo;.&nbsp; What you should know is that in Power Query you can referenced other queries in your formulas.&nbsp; In this case it&rsquo;s easy since this query returns a single value. So your final formula for the &ldquo;Potential Revenue&rdquo; column would look like this:</p>
<p>[sq_ft] * metroRentalRate</p>
<p>Now that&rsquo;s pretty nice.&nbsp; You can remove the &ldquo;RentalRates(2)&rdquo; query since it&rsquo;s not needed without breaking anything and you&rsquo;re done with that part! As a side note when doing the above, I would still use the &lsquo;reference query&rsquo; step since it results in a more efficient set of queries &ndash; the data will be downloaded by Power Query only once, rather than twice.</p>
<p>Beyond the above, I did some standard tweaks to the data returned from the OData feed.&nbsp; To map addresses better, I created a couple of columns to help Bing geocode the addresses better. Here are the queries:</p>
<p>Street Address</p>
<p>= [address] &amp; ", Chicago, IL, USA"</p>
<p>CMTY</p>
<p>= [cmty_area_name] &amp; ", Chicago, IL, USA"</p>
<p>I think the second one is interesting.&nbsp; The cmt_area_name contains names like &ldquo;Englewood&rdquo; that are regions within the city.&nbsp; Bing has some knowledge of geographic boundaries alike Countries, States, Cities, Zipcodes.&nbsp; You mileage may vary, but it&rsquo;s pretty cool when it works, which it did in this case &ndash; see the filled map below.</p>
<p>I also used the &ldquo;replace values&rdquo; option on the &ldquo;vacant&rdquo; column to change the values from &lsquo;true&rsquo;, &lsquo;false&rsquo;, and &lsquo;null&rsquo; to &ldquo;vacant&rdquo;, &ldquo;occupied&rdquo;, and &ldquo;not specified&rdquo;.&nbsp; That&rsquo;s much easier on the eyes.</p>
<h3>Show me the data</h3>
<p>Now that all the data modeling and queries are done, I created a few pages in Power BI Designer to show some of the data.&nbsp; Using a TreeMap, I&rsquo;m able to see part to whole analysis.&nbsp; I created the view below to show potential revenue by ward number.&nbsp; As you can see 4 wards account for the bulk of the potential revenue.&nbsp; You&rsquo;ll also see the distribution of properties across whether they&rsquo;re vacant, occupied, or not specified. One very interesting thing in the TreeMap is that you can see how the number of properties in not specified is actually quite high but the potential revenue for those properties is extremely low.&nbsp; The reason is that there&rsquo;s very little square footage associated with these properties.&nbsp; So they might be vacant lots.&nbsp; What&rsquo;s interesting about that is that vacant lots are sometimes easier to redevelop than lots with building on them already.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/2746.cblog5_7F6CF5DB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/2746.cblog5_5F00_7F6CF5DB.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog5" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6180.cblog5_thumb_194C7C32.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6180.cblog5_5F00_thumb_5F00_194C7C32.png" alt="cblog5" width="554" height="300" border="0" /></a></p>
<p><br />Below, I used the Filled Map feature to see which of the communities have the most vacant properties.&nbsp; Filled Maps are sometimes called <a href="http://en.wikipedia.org/wiki/Choropleth_map">choropleth maps</a>. You can see that there are a few neighborhoods with higher densities of vacant city owned property.&nbsp; That clustering makes it interesting as a potential way to focus resources on those areas to avoid a peanut butter effect.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/5554.cblog6_3CF3FAB1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/5554.cblog6_5F00_3CF3FAB1.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog6" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/0513.cblog6_thumb_602F463B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/0513.cblog6_5F00_thumb_5F00_602F463B.png" alt="cblog6" width="554" height="300" border="0" /></a></p>
<p>&nbsp;</p>
<p>Lastly we can look at the wards with the most vacant property and see where all those properties are.&nbsp; Again, you can see that clustering when looking at each property.&nbsp; This suggest there might be some really big opportunity in those areas of Chicago.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/1050.cblog7_7A0ECC91.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/1050.cblog7_5F00_7A0ECC91.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="cblog7" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/8468.cblog7_thumb_26A5DD50.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/8468.cblog7_5F00_thumb_5F00_26A5DD50.png" alt="cblog7" width="554" height="300" border="0" /></a></p>
<p>Hope you liked this analysis.&nbsp; You can find the final Power BI Designer file here:&nbsp; <a href="http://1drv.ms/1DNG2Jf" target="_blank">Chicago City Property.pbix</a></p>
<p>You can <a href="https://powerbi.com/dashboards/downloads/" target="_blank">get Power BI Designer for free by click here.</a></p>
<p>Also, if you haven&rsquo;t yet, you can signup for Power BI for free by heading over to <a href="http://www.PowerBI.com">www.PowerBI.com</a>.</p>
<p>-Lukasz</p>]]></content:encoded>
    </item>
    <item>
      <title>Power BI Dynamic Date Filtering</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/power-bi-dynamic-date-filtering</link>
      <pubDate>Thu, 05 Mar 2015 13:48:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/03/05/power-bi-dynamic-date-filtering/</guid>
      <description><![CDATA[One question I get from time to time is how&nbsp;to filter to the last week's worth of data...]]></description>
      <content:encoded><![CDATA[<p>One question I get from time to time is how&nbsp;to filter to the last week's worth of data automatically in Power BI.&nbsp; You might want the last 7 days, this week, this month, etc.&nbsp;</p>
<p>You can make it fully dynamic by combining the technique <a title="Matt Masson" href="http://www.mattmasson.com">Matt Masson</a> describes <a title="here" href="http://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/">here </a>to create a date table and add to it some Power Pivot DAX functions to classify each date into the date range you'd like.&nbsp;</p>
<p><a title="Download a sample here" href="https://onedrive.live.com/redir?resid=431fd5e3bc57eb03!119333&amp;authkey=!AOxmtHbXPUhOzcE&amp;ithint=file%2cxlsx" target="_blank">Download a sample here</a></p>
<p>OneDrive personal doesn't load the Power View sheet so download and open the example in Excel on your desktop.</p>
<p>&nbsp;</p>
<p>EDIT 7.27.2015&nbsp; - I was asked for the formulas since some folks don't have Power View.&nbsp; These should work in <a href="https://powerbi.microsoft.com/desktop">Power BI Desktop</a>, but I've not tested them there.&nbsp; Here you go:</p>
<p><strong>Power Query query:</strong></p>
<p>//let<br />//&nbsp;&nbsp;&nbsp; CreateDateTable = (StartDate, EndDate) =&gt;<br />let</p>
<p>&nbsp;&nbsp;&nbsp; StartDate=#date(2015,1,1),<br />&nbsp;&nbsp;&nbsp; EndDate=#date(Date.Year(DateTime.LocalNow()),12,31),</p>
<p>&nbsp;&nbsp;&nbsp; //Create lists of month and day names for use later on<br />&nbsp;&nbsp;&nbsp; MonthList = {"January", "February", "March", "April", "May", "June"</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , "July", "August", "September", "October", "November", "December"},</p>
<p>&nbsp;&nbsp;&nbsp; DayList = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},</p>
<p>&nbsp;&nbsp;&nbsp; //Find the number of days between the end date and the start date</p>
<p>&nbsp;&nbsp;&nbsp; NumberOfDates = Duration.Days(EndDate-StartDate),</p>
<p>&nbsp;&nbsp;&nbsp; //Generate a continuous list of dates from the start date to the end date</p>
<p>&nbsp;&nbsp;&nbsp; DateList = List.Dates(StartDate, NumberOfDates, #duration(1, 0, 0, 0)),</p>
<p>&nbsp;&nbsp;&nbsp; //Turn this list into a table</p>
<p>&nbsp;&nbsp;&nbsp; TableFromList = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , null, ExtraValues.Error),</p>
<p>&nbsp;&nbsp;&nbsp; //Cast the single column in the table to type date</p>
<p>&nbsp;&nbsp;&nbsp; ChangedType = Table.TransformColumnTypes(TableFromList,{{"Date", type date}}),</p>
<p>&nbsp;&nbsp;&nbsp; //Add custom columns for day of month, month number, year</p>
<p>&nbsp;&nbsp;&nbsp; DayOfMonth = Table.AddColumn(ChangedType, "DayOfMonth", each Date.Day([Date])),</p>
<p>&nbsp;&nbsp;&nbsp; MonthNumber = Table.AddColumn(DayOfMonth, "MonthNumberOfYear", each Date.Month([Date])),</p>
<p>&nbsp;&nbsp;&nbsp; Year = Table.AddColumn(MonthNumber, "Year", each Date.Year([Date])),</p>
<p>&nbsp;&nbsp;&nbsp; DayOfWeekNumber = Table.AddColumn(Year, "DayOfWeekNumber", each Date.DayOfWeek([Date])+1),</p>
<p>&nbsp;&nbsp;&nbsp; //Since Power Query doesn't have functions to return day or month names,</p>
<p>&nbsp;&nbsp;&nbsp; //use the lists created earlier for this</p>
<p>&nbsp;&nbsp;&nbsp; MonthName = Table.AddColumn(DayOfWeekNumber, "MonthName", each MonthList{[MonthNumberOfYear]-1}),</p>
<p>&nbsp;&nbsp;&nbsp; DayName = Table.AddColumn(MonthName, "DayName", each DayList{[DayOfWeekNumber]-1}),</p>
<p>&nbsp;&nbsp;&nbsp; WeekEnding = Table.AddColumn(DayName, "Week Ending", each Date.EndOfWeek([Date])),<br />&nbsp;&nbsp;&nbsp; #"Changed Type" = Table.TransformColumnTypes(WeekEnding ,{{"DayOfMonth", Int64.Type}, {"MonthNumberOfYear", Int64.Type}, {"Year", Int64.Type}, {"DayOfWeekNumber", Int64.Type}}),<br />&nbsp;&nbsp;&nbsp; #"Added Custom" = Table.AddColumn(#"Changed Type", "MonthYear", each Text.Range([MonthName], 0, 3) &amp; "-" &amp; Number.ToText([Year])),<br />&nbsp;&nbsp;&nbsp; #"Added Custom1" = Table.AddColumn(#"Added Custom", "MonthYearNumber", each [Year] * 1000 + [MonthNumberOfYear]),<br />&nbsp;&nbsp;&nbsp; #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"MonthYearNumber", Int64.Type}}),<br />&nbsp;&nbsp;&nbsp; #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type1", "Week Ending", "Copy of Week Ending"),<br />&nbsp;&nbsp;&nbsp; #"Renamed Columns" = Table.RenameColumns(#"Duplicated Column",{{"Copy of Week Ending", "WeekEndingDate"}}),<br />&nbsp;&nbsp;&nbsp; #"Changed Type2" = Table.TransformColumnTypes(#"Renamed Columns",{{"WeekEndingDate", type date}}),<br />&nbsp;&nbsp;&nbsp; #"Renamed Columns1" = Table.RenameColumns(#"Changed Type2",{{"Week Ending", "WeekEnding"}})<br />in<br />&nbsp;&nbsp;&nbsp; #"Renamed Columns1"<br />//in<br />//&nbsp;&nbsp;&nbsp; CreateDateTable</p>
<p>&nbsp;</p>
<p><strong>DAX Measures</strong><br />Today:=DATE(year(now()),MONTH(NOW()), DAY(NOW()))</p>
<p><strong>DAX Calculated Columns</strong><br />IsInCurrentWeek<br />=if([isCurrentYear] &amp;&amp; WEEKNUM(NOW())=[WeekOfYearNumber],1,0)</p>
<p>IsInLastWeek<br />=if([isCurrentYear] &amp;&amp; (WEEKNUM(NOW())-1)=[WeekOfYearNumber],1,0)</p>
<p>IsInCurrentYer<br />=if(YEAR(NOW())= [Year],1,0)</p>
<p>WeekOfYearNumber<br />=WEEKNUM([Date])</p>
<p>IsLast30Days<br />=if( AND( [Date]&nbsp; &gt;= [Today]&nbsp; - 30 , [Date] &lt;= [Today] ),1,0)</p>
<p>&nbsp;HTH,</p>
<p>-Lukasz</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Seattle Building Permits visualized in Power BI with Socrata OData and data.seattle.gov</title>
      <link>https://docs.microsoft.com/archive/blogs/lukaszp/seattle-building-permits-visualized-in-power-bi-with-socrata-odata-and-data-seattle-gov</link>
      <pubDate>Sun, 22 Feb 2015 14:14:00 GMT</pubDate>
      <dc:creator><![CDATA[Lukasz Pawlowski -- MS]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/lukaszp/2015/02/22/seattle-building-permits-visualized-in-power-bi-with-socrata-odata-and-data-seattle-gov/</guid>
      <description><![CDATA[&nbsp;
Living in Seattle, it&rsquo;s quite fun to keep track of what&rsquo;s happening through...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>Living in Seattle, it&rsquo;s quite fun to keep track of what&rsquo;s happening through data.&nbsp; The Open Data initiative from the City of Seattle is a treasure trove of information that you can explore here: <a href="http://data.seattle.gov">http://data.seattle.gov</a>.&nbsp; This is all power by <a href="http://www.socrata.com/" target="_blank">Socrata</a>, as are many other open data initiatives for Cities and organizations.&nbsp; I wanted to explore that data using Power BI, specifically Power BI designer.&nbsp; In a future post, I&rsquo;ll show how to monitor insights using the new Power BI Dashboards feature, but that&rsquo;s for later.</p>
<p>I wanted to look at Building Permit data &ndash; since there&rsquo;s a lot of construction happening in and around town.&nbsp; I was able to find the &ldquo;Building Permits : Current&rdquo; data set which lists &ldquo;Building Permits issued in the past five years or currently in progress&rdquo;.&nbsp; You can see it here:</p>
<p><a title="https://data.seattle.gov/Permitting/Building-Permits-Current/mags-97de" href="https://data.seattle.gov/Permitting/Building-Permits-Current/mags-97de">https://data.seattle.gov/Permitting/Building-Permits-Current/mags-97de</a></p>
<p>I pulled that data into Power BI Designer.&nbsp; You can download the designer at the link below if you&rsquo;d like to try it for yourself:&nbsp;</p>
<p><a title="http://www.powerbi.com/dashboards/downloads/designer/" href="http://www.powerbi.com/dashboards/downloads/designer/">http://www.powerbi.com/dashboards/downloads/designer/</a></p>
<p>You can follow the steps below or play with the final file, download it from here:</p>
<p><a title="Seattle Building Permits OData.pbix" href="http://1drv.ms/1vZ91ah" target="_blank">Seattle Building Permits OData.pbix</a>&nbsp;</p>
<p>Let&rsquo;s walk through step by step:</p>
<p>The data.seattle.gov site for building permits that exposed through Socrata. <br />1. Click the Export option <br />2. Select OData <br />3. Copy the OData URL</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/8686.Seattle-Building-Permits-Get-Odata-from-Socrata_538D4C31.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/8686.Seattle_2D00_Building_2D00_Permits_2D00_Get_2D00_Odata_2D00_from_2D00_Socrata_5F00_538D4C31.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Get Odata from Socrata" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/8203.Seattle-Building-Permits-Get-Odata-from-Socrata_thumb_6EC5A532.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/8203.Seattle_2D00_Building_2D00_Permits_2D00_Get_2D00_Odata_2D00_from_2D00_Socrata_5F00_thumb_5F00_6EC5A532.png" alt="Seattle Building Permits Get Odata from Socrata" width="829" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>Open Power BI Designer. <br />1. Under "New Source" select "OData Feed".</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/3005.Seattle-Building-Permits-Use-OData-Source-in-Power-BI-Designer_7578AEB5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/3005.Seattle_2D00_Building_2D00_Permits_2D00_Use_2D00_OData_2D00_Source_2D00_in_2D00_Power_2D00_BI_2D00_Designer_5F00_7578AEB5.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Use OData Source in Power BI Designer" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7028.Seattle-Building-Permits-Use-OData-Source-in-Power-BI-Designer_thumb_4E3E6580.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7028.Seattle_2D00_Building_2D00_Permits_2D00_Use_2D00_OData_2D00_Source_2D00_in_2D00_Power_2D00_BI_2D00_Designer_5F00_thumb_5F00_4E3E6580.png" alt="Seattle Building Permits Use OData Source in Power BI Designer" width="829" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>Fill in the URL and press OK. <br />1. Put the OData Feed URL here.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/0525.Seattle%20Building%20Permits%20Use%20OData%20Source%20in%20Power%20BI%20Designer%20set%20the%20URL.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/0525.Seattle-Building-Permits-Use-OData-Source-in-Power-BI-Designer-set-the-URL.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/0525.Seattle%20Building%20Permits%20Use%20OData%20Source%20in%20Power%20BI%20Designer%20set%20the%20URL.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x364/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51/0525.Seattle-Building-Permits-Use-OData-Source-in-Power-BI-Designer-set-the-URL.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Start using Power BI Designer to explore the data. <br />1. There are the fields from the OData Feed.&nbsp; We call this the "Fields List". <br />2. You can drag fields from the "Fields List" into this area we call the "Canvas".</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6560.Seattle-Building-Permits-Learn-about-Fields_6976BE81.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6560.Seattle_2D00_Building_2D00_Permits_2D00_Learn_2D00_about_2D00_Fields_5F00_6976BE81.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Learn about Fields" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/1373.Seattle-Building-Permits-Learn-about-Fields_thumb_6C1F7A32.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/1373.Seattle_2D00_Building_2D00_Permits_2D00_Learn_2D00_about_2D00_Fields_5F00_thumb_5F00_6C1F7A32.png" alt="Seattle Building Permits Learn about Fields" width="829" height="365" border="0" /></a></p>
<p>&nbsp;</p>
<p>If you drag "value" to the canvas, a default visual is created. <br />1. This is the field I dragged.&nbsp; You can also check the check box. <br />2. Use this button to quickly change the visual.&nbsp; <br />3. You can also change visuals from here. Just make sure to select the visual you want to change first.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7462.Seattle-Building-Permits-First-Visual_44E530FD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7462.Seattle_2D00_Building_2D00_Permits_2D00_First_2D00_Visual_5F00_44E530FD.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits First Visual" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/0121.Seattle-Building-Permits-First-Visual_thumb_64940AC5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/0121.Seattle_2D00_Building_2D00_Permits_2D00_First_2D00_Visual_5F00_thumb_5F00_64940AC5.png" alt="Seattle Building Permits First Visual" width="829" height="365" border="0" /></a></p>
<p>&nbsp;</p>
<p>Here's my first report after playing with the data for just a few minutes. <br />1. This is the total value of all permits returned by the OData feed. <br />2. This is the distinct count of permits by permit_type. <br />3. This tree map shows that Commercial is the largest category by total value.&nbsp; Interestingly it shows all the applicant names and how those applicants contribute to the total value of each category.&nbsp; <br />4. This trend shows the distinct count applications by date. <br />5. This data point is fascinating!&nbsp; The data sets has 5 years of building permit data and any "current" permits.&nbsp; So permits from before this point are really old.&nbsp; Might be worth investigating more why they're still open.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/8561.Seattle-Building-Permits-Insights_2E25E974.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/8561.Seattle_2D00_Building_2D00_Permits_2D00_Insights_5F00_2E25E974.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Insights" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/1220.Seattle-Building-Permits-Insights_thumb_7FCC63C6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/1220.Seattle_2D00_Building_2D00_Permits_2D00_Insights_5F00_thumb_5F00_7FCC63C6.png" alt="Seattle Building Permits Insights" width="829" height="365" border="0" /></a></p>
<p>&nbsp;</p>
<p>The report is interactive by default. <br />1. I clicked on "COMMERCIAL" here and it&nbsp; cross filtered all the other visuals for me.&nbsp; So I can see the trend and totals just for what I selected.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/5344.Seattle-Building-Permits-Highlighting_625A12BA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/5344.Seattle_2D00_Building_2D00_Permits_2D00_Highlighting_5F00_625A12BA.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Highlighting" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/3223.Seattle-Building-Permits-Highlighting_thumb_6FC025C0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/3223.Seattle_2D00_Building_2D00_Permits_2D00_Highlighting_5F00_thumb_5F00_6FC025C0.png" alt="Seattle Building Permits Highlighting" width="829" height="365" border="0" /></a></p>
<p>&nbsp;</p>
<p>When I switch to "Query" I can see how the data was loaded. <br />1. Clicking here switch to show the data that was loaded.&nbsp;&nbsp; Clicking "Report" takes me back to the report. <br />2. I can have multiple queries in a report.&nbsp; They all show up here.&nbsp; To get more queries, select "New Source" in the ribbon. <br />3. I can work on the data to transform it, mash it up, clean it up, or what have you.&nbsp; We call these actions "Steps".&nbsp;&nbsp; The steps show up here.&nbsp; You view and fix the steps.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/2642.Seattle-Building-Permits-Query-Pane-intro_76732F43.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/2642.Seattle_2D00_Building_2D00_Permits_2D00_Query_2D00_Pane_2D00_intro_5F00_76732F43.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Query Pane intro" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6787.Seattle-Building-Permits-Query-Pane-intro_thumb_03D9424A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6787.Seattle_2D00_Building_2D00_Permits_2D00_Query_2D00_Pane_2D00_intro_5F00_thumb_5F00_03D9424A.png" alt="Seattle Building Permits Query Pane intro" width="826" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>Odata can contain nested data.&nbsp; You can work with it without a problem. <br />1. This column has more data.&nbsp; It will shows as "Record", "Table", or "List" in the UI. <br />2. Press this button to expand it.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/2570.Seattle-Building-Permits-Expand-a-column_7F62C182.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/2570.Seattle_2D00_Building_2D00_Permits_2D00_Expand_2D00_a_2D00_column_5F00_7F62C182.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Expand a column" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/5238.Seattle-Building-Permits-Expand-a-column_thumb_41D563B9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/5238.Seattle_2D00_Building_2D00_Permits_2D00_Expand_2D00_a_2D00_column_5F00_thumb_5F00_41D563B9.png" alt="Seattle Building Permits Expand a column" width="826" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>This is my query after I expanded a few columns.&nbsp; I selected the green column so they're easier to see. <br />1. Notice how I have multiple steps now.&nbsp; They're sequential so I can click through them to see what the query is doing. <br />2. I can always edit a step by pressing here.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7384.Seattle-Building-Permits-Query-showing-steps_0F71903A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7384.Seattle_2D00_Building_2D00_Permits_2D00_Query_2D00_showing_2D00_steps_5F00_0F71903A.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Query showing steps" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7801.Seattle-Building-Permits-Query-showing-steps_thumb_3C867D08.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7801.Seattle_2D00_Building_2D00_Permits_2D00_Query_2D00_showing_2D00_steps_5F00_thumb_5F00_3C867D08.png" alt="Seattle Building Permits Query showing steps" width="826" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>I created a page that shows where each application is planning to build.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/0572.Seattle-Building-Permits-Where-applicants-are-building-things_7EF91F3E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/0572.Seattle_2D00_Building_2D00_Permits_2D00_Where_2D00_applicants_2D00_are_2D00_building_2D00_things_5F00_7EF91F3E.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Where applicants are building things" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/6170.Seattle-Building-Permits-Where-applicants-are-building-things_thumb_2C7A3F02.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/6170.Seattle_2D00_Building_2D00_Permits_2D00_Where_2D00_applicants_2D00_are_2D00_building_2D00_things_5F00_thumb_5F00_2C7A3F02.png" alt="Seattle Building Permits Where applicants are building things" width="826" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>Using filters and different visuals, you can quickly find insights.&nbsp; Here quickly see which applicants have applied for permits.&nbsp; I've captured a view that shows that Patterson has applied for many more permits than Belcher, for example.&nbsp; But for both those applicants, the total of their permit values is larger than half a million dollars.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/5280.Seattle-Building-Permits-Filter-to-find-insight_7A166B82.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/5280.Seattle_2D00_Building_2D00_Permits_2D00_Filter_2D00_to_2D00_find_2D00_insight_5F00_7A166B82.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Seattle Building Permits Filter to find insight" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/51/51/metablogapi/7762.Seattle-Building-Permits-Filter-to-find-insight_thumb_20784ECE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-51-51-metablogapi/7762.Seattle_2D00_Building_2D00_Permits_2D00_Filter_2D00_to_2D00_find_2D00_insight_5F00_thumb_5F00_20784ECE.png" alt="Seattle Building Permits Filter to find insight" width="826" height="364" border="0" /></a></p>
<p>&nbsp;</p>
<p>There it is.&nbsp; A simple interactive view of Seattle building permits data.&nbsp; The OData feed from Socarata works great but unfortunately doesn&rsquo;t include zip code information.&nbsp; That would have allowed me to create a density map of neighborhoods showing where investment is going. Maybe someone from the City of Seattle will read this, add the zip code and I&rsquo;ll do a follow up.&nbsp;</p>
<p>Next step will be publishing this to <a title="Power BI" href="http://www.powerbi.com" target="_blank">Power BI</a> to monitor it.&nbsp; I&rsquo;ll do that in a future blog post.</p>
<p>Let me know what you think in the comments.&nbsp; Would love to answer any questions you might have.</p>
<p>HTH,</p>
<p>Lukasz</p>]]></content:encoded>
    </item>
  </channel>
</rss>