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

SSRS 2008 R2: How to dynamically size your INDICATORS

The indicators that are available in SQL 2008R2 adds great visualizations to your reports. I was recently building an SSRS demonstration and I stumbled upon an additional feature that makes the indicator even more visually appealing. Using a not so obvious property of the indicator you can set its size. The value must be between 0 and 1 or an expression that results in a value between 0 and 1.

To change the size of an indicator, ensure that you have selected the indicator that you want to resize. Similar to the following image:


Next click F4 and the Properties window will open. Locate the IndicatorStates property, click in the text box, and click the ellipses button that appears.

Once you click the ellipses the IndicatorState Collection Editor will open.

Several options are available in this editor, but for now I will focus on the ScaleFactor. According to the description given by the editor, the ScaleFactor determines the mumber by which the indicator is scaled. I am not sure what a mumber is,but I think they meant number. Either way, changing this value from the 1 to anything between 0 and 1 will reduce the size of the indicator. For example, if I change the size to .5 the indicator would look like this instead of like this . In addition to providing an explicit value you can also provide an expression. Remember the expression must result in a value that is between 0 and 1. Assume that, not only do you want the indicators color to visually represent performance, but you would also like the size to be an indicator. Take a look at the chart below:

The first three rows show the Total Sales for each category and the final row represents the Total Sales for all categories. A quick way to implement the indicator sizing strategy is to base the size on a percentage of total calculation. In the case of the above report it would be the Total Sales of one category divided by the Total Sales for all categories. For example, the totals sales for the Accessories category divided by the Total Sales for all categories: (9,093,653.27 / 30, 093,177.09).

To accomplish this return to the IndicatorState Collection Editor, click the drop down in the ScaleFactor property text box and select Expression. In the expression editor you will type and expression similar to the following:


Once you have done this click OK twice and run your report. You will notice that the indicators are different sizes. These sizes are equal to the result of the expression for each row.

Notice the smaller the category Total Sales the smaller the indicator. In fact, the indicator for the Clothing category is barely noticeable. If you have any questions or comments regarding this post please feel free to email me at

Talk to you soon

Patrick LeBlanc, founder SQL Lunch

Rate this article:
No rating

PatrickLeBlanc PatrickLeBlanc

Other posts by PatrickLeBlanc

Please login or register to post comments.