Business Intelligence Blogs

View blogs by industry experts on topics such as SSAS, SSIS, SSRS, Power BI, Performance Tuning, Azure, Big Data and much more! You can also sign up to post your own business intelligence blog.

«November 2015»

DirectQuery in Power BI Desktop

In the latest Power BI Desktop a new Preview features was released that now allows you to connect using DirectQuery to either SQL Server or Azure SQL Databases.  DirectQuery is a really neat feature that allows you to point to the live version of the data source rather than importing the data into a data model in Power BI Desktop. 

Normally when you want to get an updated dataset in the Power BI Desktop you would have to manually click the refresh button (this can be automated in the Power BI Service), which would initiate a full reimport of your data.  This refresh could take a variable amount of time depending on how much data your have.  For instance, if you’re refreshing a very large table you may be waiting quite a while to see the newly added data. 

With DirectQuery data imports are not required because you’re always looking at a live version of the data.  Let me show you how it works!

Turning on the DirectQuery Preview

Now, because DirectQuery is still in Preview you must first activate the feature by navigating to File->Options and settings->Options->Preview Features then check DirectQuery for SQL Server and Azure SQL Database


Once you click OK you may be prompted to restart the Power BI Desktop to utilize the feature.

Using DirectQuery in Power BI Desktop

Next make a connection either to an On-Premises SQL Server or Azure SQL database.

Go to the Home ribbon and select Get Data then SQL Server.


Provide your Server and Database names then click OK. ***Do not use a SQL statement.  It is not currently supported with DirectQuery***


From the Navigator pane choose the table(s) you would like to use.  I’m just going to pick the DimProduct table for this example and then click Load.  You could select Edit and that would launch the Query Editor where you could manipulate the extract.  This would allow you to add any business rules needed to the data before visualizing it.


Next you will be prompted to select what you want to connect to the data. Again, Import means the data

Read more

The Big Data Blog Series

Over the last few years I’ve been speaking a lot on the subject of Big Data. I started by giving an intermediate session called “Show Me Whatcha’ Workin’ With”. This session was designed for people who had attended a one hour introductory session that showed you how to load data, to look at possible applications … Continue reading The Big Data Blog Series
Read more

Using Power Query to Parse your Inbox

  • 13 December 2013
  • Author: DevinKnight
  • Number of views: 8242

One of the nice new features that was added to Power Query with the latest update in December is the ability to connect to Microsoft Exchange as a data source.  You can download this update now here:

Here’s a quick demonstration of how you may use the Microsoft Exchange data source in a Power BI solution:

After downloading and installing Power Query launch Excel and navigate to the Power Query tab.  If you don’t see the Power Query tab you may need to turn on the feature, which I describe here. From the Power Query Tab select From Other Sources and pick From Microsoft Exchange.


Next you must provide your Microsoft Exchange credentials.


It will then prompt you to authorize Power Query to access your account.


Once the authentication completes the Navigator pane will launch with a view of your Exchange account.


In the Navigator pane you can select you mailbox, calendar, contacts, or tasks.  You could hover over each of these options to get a preview of what the data looks like.  For this demonstration select Mail then pick Edit Query.  This will launch the Query Editor with an entry for each email in your Inbox.  Of course if you have thousands of emails this will show just a sampling of the email you have.


I’ve hidden the results in this screen shot to protect the innocent but it does indeed return back my mailbox results.  Here’s the kind of metadata it returns.

  • Inbox Path
  • Subject
  • Sender
  • To
  • CC
  • Time Sent
  • Time Received
  • Importance
  • Is Read?
  • Has Attachments?
  • Preview of the Body
  • The Full Email Body
  • Etc…

What I’d like to do is see who sends me the most emails. So I expand the sender column to return back the Name of the sender for each of these emails.  I only care about the Name column so I’ll filter out the address.


For this example I only care about counting the number of emails I get by sender so I’ll remove all the irrelevant columns and only keep the Sender.Name.  To remove all other columns select the one you want to keep then right-click on one of the columns and select Remove Other Columns (My screenshot show this on a different column). 


This will leave you with only one column but we need at least one other column to aggregate the number of Emails.  This can be done by creating an Index column.  Right-Click on the only remaining column and select Insert Index Column.  This will be used for returning a count of emails.  This could have also likely been done by doing a count of the ID column that was in the original dataset.  Click Apply & Close to take the results of this Power Query solution and build a report on it.  This may take a while depending on how many emails you have. 

I’ve decided to create a Power View Report to visualize who emails me most.  With the Power Query table selected in Excel go to the Insert menu and select Power View.  Once Power View launches it will automatically place the Sender and Index column into a table.  Change the Index column to Count (Not Blank).  This will produce an output that shows each sender and the number of emails from each.


Now, change this visualization to a Stacked Bar chart to easily visualize each sender and the number of emails they send.  After sorting the chart descending I see the final result shows that the Brian Knight, my brother and owner of the company, is the person that fills up my inbox the most.


Now this is a neat demonstration, but how can you make it work for a business solution?  Personally, I know severally organizations that could use this for parsing support inboxes to organize and see which users have taken up the most time (inbox time at least) from support.  So yes there is a business application and a pretty neat one at that!

Go download the latest Power Query update here:

Are you interested in learning more about Power BI?  Attend one of the classes I offer either in person or virtually

Virtually –

In Person Workshop –

Rate this article:
No rating


Other posts by DevinKnight

Please login or register to post comments.