Monthly Archives: February 2014

Adding Good Favicons to your MVC Based Website

When you visit websites, you may or may not have noticed the small icons that appear in the title bar areas. These are called Favicons. Here’s an example of one in Chrome:


In Internet Explorer, they appear in several places:

image     image

They are only a small visible aspect of your website but they greatly improve how professional the site looks in a browser. In IE, they also appear when you open a new page:


So, how do you create these, and how do you add them to your site?

I had tried creating them using a variety of icon editors including the excellent IcoFX. However, I could never create really good looking Favicons as I must be a little art-challenged. I’m sure it’s a left-brain/right-brain thing. I’d try to draw them but I’d end up giving up and using something boring like this:


It’s quite hard to create a small version of your company’s logo, etc.

On one of the local mailing lists, our buddy Andrew Coates from Microsoft, pointed out one of their sites that I’d never seen before. It’s awesome for creating favicons by scaling existing images. Here’s how I created the one in the images above:

First Step – Transparent PNG

The first step was to make sure I had a transparent png file that contained the logo that I wanted to use. Even though you could use a white background, it looks much better if it’s transparent. (Skip this if you already have one). To create that, I used Paint.Net (yet another awesome free tool). I loaded the existing logo that had a white background like so:


In many of these tools, it’s not so obvious how to make the background transparent. In Paint.Net, all I needed to do was to select the paint bucket as a tool, then use the “More” option in the color palette, and move the Transparency-Alpha setting fully to the left:


Notice that the primary color now looks transparent. Then I just used the paint bucket tool to change the white to transparent.


Then I saved the file.

Step 2 – Create the Favicon

The site that Andrew recommended was Navigate to that site. We then want the icon editor:


Next choose to Import:


Use the Upload button to bring in the transparent png that was created earlier, and then move and resize the guide window until you get as much of the logo that you want displayed:


When it looks good, make sure that all four icon sizes are selected via the checkboxes and then click OK. You’ll then see your logo in the main window, and you can choose to export it:


Save the file that is downloaded as favicon.ico.

Step 3 – Add the Favicon to your MVC Project

Copy the icon file into the root  folder in your MVC project, and make sure you have included the file in the project. James Green pointed out to me that many older browsers still go looking for the specific filename favicon.ico and in the root folder of the website, so it sounds like good advice to always place them there.

Finally, add a reference to the icon file in your _Layout.cshtml file in the head section:


And you’re done. Enjoy!

New SQL Server Spatial Course

I’ve always thought that the support for spatial data types that was added in SQL Server 2008 was one of the best parts of that release.

In SQL Server 2012, a great set of enhancements were made to the spatial support.

We’ve had lots of interest lately in SQL Server spatial so we’ve been working on a new course that targets it specifically. We’re pleased that we’ve now added a brand new one day SQL Server Spatial Core Skills course to our list of regularly scheduled courses. It covers a wide variety of topics from understanding the data types, to loading data, geolocation, indexing, etc. It also covers the enhancements that were made in 2012.

The first public schedule for this course is April 14th in Melbourne. Details are here:

Implement Parameters using Slicers in #powerpivot #dax #tabular

Apparently you cannot pass an argument to a DAX measure. In reality, you can interact with a slicer that has the only purpose of representing a parameter used by a DAX formula. You just create a table in the Power Pivot or Tabular data model, without creating any relationship with other tables in the same data model. This techniques is similar to the tool dimension you can implement in Multidimensional, but is simpler and somewhat more flexible. We described the DAX technique in Parameter Table pattern, published on

In the article we provided several examples, including how to implement cascading parameters using two slicers and presenting only valid combinations of parameters. If you miss the DateTool Dimension in Tabular, you will also see how to implement a Period table in DAX using the Parameter Table pattern, which is a good technique for injecting arguments and selecting algorithms in simulation models.

Holy Cow, It has been a while

Well, it has been over a year since my last insanely optimistic blog about the next year , but this year it is going to be (actually) different (not like the last time I said it would be different) Usually, like pretty much everyone on earth, I overestimate just how much I can get done in the following twelve months by some impressive amount. Writing, speaking, blogging, exercising, etc etc. Not this year. I am specifically going the other direction, saying I am doing less. Specifically more writing…(read more)

Data Visualizations

A couple of weeks back was a really exciting time for us. Less than a year after we released Office 365 for Businesses, we announced the general availability of Power BI for Office 365. You may have read previous blog articles by Quentin Clark on Making Big Data Work for Everyone and Kamal Hathi on Simplifying Business Intelligence through Power BI for Office 365. In this article, we’ll outline how we think about visualizations.

Why Visualizations Matter

While a list of items is great for entering or auditing data, data visualizations are a great way to distill information to what matters most that is understandable quickly. They work by engaging visual parts of our brains, which are inherently designed to detect patterns quickly. On the left, for example, we have a list of research grants, on the right a summarization of the overall amounts by month of the year which is a much easier way to understand the relative spikes in September and October. As you can see, visualizations are great for making us all more productive with data.

Visualizations in Productivity Apps

We have the privilege of having the largest community of users of productivity applications in the world. Thanks to their ongoing feedback, we are able to understand their changing needs, and ensure Office evolves in directions our customers find most useful.

Back in the early days of computing, graphics and visualizations were not mainstream capabilities.  Most machines lacked the graphics horsepower and memory needed, and people had to draw illustrations and charts by hand which was time consuming and fraught with mistakes. That all changed when the Macintosh and PCs made graphics a first class citizen. Microsoft introduced Microsoft Chart in 1984, and in 1985 as a feature in Mac Excel 1.0.  

Advertisement, September 1984

This was a huge achievement. Customers could now use their computers to draw charts and other graphics for reports. Based on their feedback, numerous charting and graphics features were added to Office: charting was added to Excel 2.0 for Windows in 1987, 3D charts were introduced in 1990, and the chart wizard made it even easier to create charts in 1992. As computers spread from businesses into the homes for consumer uses, GPUs became more commonplace, and memory costs dropped, these innovations became broadly available.

Over the last decade, customer needs have evolved significantly, with more emphasis on faster creation, more interactivity, support for new types of data, and broader availability. Following is a list of innovations in recent releases, described to set the context of where we are as well as where we are headed.

Faster Creation of Visualizations

Excel 2007 introduced the ability to set the style of a chart with one click and leverage richer graphics such as shadows, anti-aliased lines, and transparency.  

Office 2013 was one of our most ground-breaking releases. Quick Analysis provided immediate views of various visualization options and reduced the time to add them on your data, Chart Recommendations used intelligent heuristics to suggest charts, and Automatic Relationship Detection allowed users to more easily analyze data stored in separate tables. The charting functionality provided live preview, gorgeous styles, richer data labels, and easier ways to add chart elements, apply styles, and filter with user interfaces directly on the charts. 

Quick Analysis in Excel 2013 Recommended Charts in Excel 2013

Richer Interactivity

Part of my role at Microsoft involves presenting on various topics to stakeholders, and increasingly most of these include data visualizations. Only a few years back, I remember creating presentations with snapshots of charts pasted in as images, and carrying a notepad with interesting data nuggets that others might ask about. Later, as I got more “sophisticated”, the appendix of these presentations would contain numerous slides, each with an interesting snippet that someone might ask about, and I could jump to the relevant one to dig in deeper. For the very important presentations, these slides were printed out beforehand, together with printouts of the underlying data that someone could go through on the spot to answer questions that’d come up.

Data visualizations inherently invite questions. And not just the simple ones, but deep insightful ones, that go beyond making better point decisions to having a deeper understanding of how the underlying system behaves. Having an environment where we can test our hypotheses quickly utilizes the best of our creativity and learnings, making us effective participants instead of mere spectators, full on drivers instead of backseat passengers giving directions once in a while.

To enable such experiences, Excel 2010 introduced Slicers, an interactive way to filter data within Excel, and Excel 2013 introduced Timelines to make it trivial to compare data over different time period. 

Slicers in Excel 2010 Timeline in Excel 2013

Excel 2013 also introduced Power View, and with it brought beautiful interactivity to visualizations and more fluid exploration capabilities.

Power View in Excel 2013

With Power View, customers can create dashboards of interactive visualizations that provide instant answers to variety of questions. This capability has resonated well with our customers, one of whom mentioned the rigidity of static snapshots during meetings has been replaced by the “Power View lifestyle”, their term for the transformational way of presenting and using information.

We are very excited to have introduced Q&A as part of the Power BI launch. This innovative experience makes it even easier to understand your data by providing a natural language experience that interprets your question and immediately serves up the correct answer on the fly in the form of an interactive chart or graph. These visualizations change dynamically as you modify the question, creating a truly interactive experience with your data.


Visualizations on All Data

In addition, both data volumes and the types of data customers want to visualize have expanded as well.

Excel 2013 also introduced the Data Model, opening the door for workbooks that contained significantly larger datasets than before, with richer way to express business logic directly within the workbook.

Increasingly, we have access to geospatial data, and recently introduced Power Map brings new 3D visualization tool for mapping, exploring, and interacting with geographical and temporal data to Excel, enabling people to discover and share new insights such as trends, patterns, and outliers in their data over time. In addition, with Power Map, users can easily capture and distribute their insights in the form of an interactive movie, telling compelling stories about their data.


Power Map in Excel 2013

Visualizations Everywhere

As customers are creating insights and sharing them, we have also invested in ensuring SharePoint 2013 and Office 365 provide full fidelity rendering as the desktop client so their products remain beautiful wherever it’s consumed.

What’s Next?

The resurgence of importance of data visualization in this decade, and rise of more form factors where these will be consumed have made this an exciting field once again. Deeper interactivity that blend analysis and visualizations even more fluidly, newer types of visualizations that enable you to see deeper insights more easily, richer experiences on the devices customers use most, and great storytelling experiences are just a few of the areas we’re investing in to make sure Office remains the productivity apps of choice as our customer needs evolve.

Eran Megiddo
Partner Director of PM
Microsoft Office – Analytics and Presentation Services

 Ashvini Sharma
Principal Group Program Manager 
Office Data Experiences

SQL Server Query Performance Guidelines Tutorial

In my years being a DBA I�ve seen many (even made some myself) common mistakes when reviewing the SQL queries that run against the systems I maintain. With this experience I�ve found that there are a some general guidelines that should be followed when writing queries and also when designing a database schema. Read this tutorial to learn more.

Connecting to #powerpivot from an external program (such as #Tableau)

Many people requested me how to connect to Power Pivot from an external program, without publishing the workbook on SharePoint or on Analysis Services Tabular. I always said it is not possible (for both technical and licensing reasons), but someone observed that Tableau is able to extract data from a Power Pivot data model connecting directly to the xlsx file. I wanted to investigate how they solved the limitations that exists.

From a technical point of view, you have to install a Tableau Add-In for Power Pivot Excel (it’s available for both 32 and 64 bit). Then, you connect using the Tableau Desktop software selecting the Microsoft Power Pivot connection. You choose a local Excel file and click Connect. The list of perspective appears in a combo box.


You click ok and you navigate into the Power Pivot data model. But what’s happening? Tableau runs an Excel instance (probably by using Excel object model) and then connects through the Tableau Add-In for Power Pivot that you installed before. Probably this add-in acts as a bridge between the process running Excel and the process running Tableau. This solve the technical problem, and it would be interesting to know how to use the same add-in from other programs without having to write the same add-in again. I know many ISVs that would love to do that!

But before starting your project in Visual Studio to do the same (after all, it shouldn’t be rocket science writing such a connector), consider the license agreement (EULA) of Office. It says that “Except for the permitted use described under “Remote Access” below, this license is for direct use of the software only through the input mechanisms of the licensed computer, such as a keyboard, mouse, or touchscreen. It does not give permission for installation of the software on a server or for use by or through other computers or devices connected to the server over an internal or external network.”. It seems we are in gray area here. The access to Excel is not direct. But at the same time, it is not made on another computer, and technically you are using keyboard, mouse and/or touchscreen when you are using Tableau Desktop.

This is certainly an unsupported scenario (and if the background Excel process hangs for any reason, you have to kill it in Task Manager). But if the licensing allows that, or if Microsoft tolerate this, probably many companies writing software (I have a long list of requests I received…) could be interested in doing the same.

I would love to hear some official word on this topic…