Skip to main content

Live connecting to Visual Studio tabular project via Power BI

Case – Live connecting to visual studio analysis service tabular project via Power BI.

Why this has happened 

In some cases we have millions of data which is practically impossible to load into Power BI. In such situation it is easier to live connect the data with Power BI for faster data retrieval and analysis.

What are needed and why are they needed

You need to have Microsoft SQL Server Management Studio for managing the databases and tables also you need Microsoft Visual Studio to create an analysis tabular project also along with that you need Power BI to live connect to the tabular project for reports and dash board creation.

Microsoft SQL Server Management Studio 

Creating SQL Server Authentication 

 First you need to start Microsoft SQL Server Management Studio and create a new SQL server authentication. In order to do this first login with your windows authentication which does not require any password to connect.



As shown in the above image select New Login from Logins which is in the security option.


Create a new user as shown above, I have created a new user named TestUser while selecting “public” and “syadmin” from the “Server Roles” which you can find in the “Select a page” option in the top left corner of the above image.



Now login again with the SQL Server Authentication credentials for the TestUser in Microsoft SQL Server Management Studio.



Creating a Tabular Project in Visual Studio 

 Now it is time to create a new tabular project in visual studio and connect it to a database in Microsoft SQL Server Management Studio using the credentials of TestUser.

Start the Visual Studio and in the left corner of the task bar click “file” and select “new” which is the first option you will find, then select “project”. If you follow the above steps you will get the following visual.


As shown in the above image select analysis service from Business Intelligence then select Analysis Service Tabular project which is the second option, I named the new tabular project as TestUserTabularProject. Once you press ok it will ask for a selection for analysis service instance and compatibility level which we are not going to look in more depth but select the integrated service which is much preferred for analysis service instance and leave the default option chosen for compatibility level.

Connecting the tabular project to a database in Microsoft SQL Server Management Studio 

Once you have created the tabular project you need to get data to it. In order to do this you need to press the barrel symbol icon found in the task bar, now I will give a screen shot of the task bar and try to find it yourself.


Can you notice the icon I’m saying in the second task bar, which is third from the green triangle start option?

Now click that icon which is actually “connect to data source option” and there choose Microsoft SQL server as shown below and press next.



Once you have clicked next as shown above you will get the following option pane.



As shown in the above image select all the respective fields and give your login credentials for SQL server authentication. Once you are done then select Test Connection in order to verify that the connection is established with the SQL server then select a data base of your choice which you have in your SQL server, in my case I have a Make-a-Mammal database and I have successfully connected to it. If you don’t have any database then you can also create a new one in SQL server management studio and then select it from here.




Once you press next you will be asked to specify the credentials to be used by the analysis server to connect to the data source and there you have four options but for this case let us choose the credential of the “SERVICE ACCOUNT” and then press next.




Once you press next you will be asked how you would prefer to load data, for this case let us go with “Select from a list of tables and views to choose the data to import” and then press next, we can select the tables and views that are to be imported in the next step.

Finally you will be directed to select the tables of your choice from the list of tables and views available in the database, in this case I have selected all the available tables by pressing the icon next to the heading "source table" as shown below and then pressed finish.


Once I pressed finish all the tables will be loaded as shown below and then close it.



Now the tables and rows have to be deployed to the tabular project, in order to do this just press the start icon in the second task bar with the green triangle icon in visual studio which will result as following.



Live connecting the tabular project to Power BI

Now it’s time to live connect with the tabular project, in order to do this we need to select get data from the data source and select “SQL Server Analysis Services database” from the whole range of data sources available.



Once you select connect you will be displayed with the following.




Here you need to select the server name in this case it is the name of my computer because I’m using it as my server, then I selected “Connect live option” and clicked ok which will direct me to the following display.






Now you can see the tabular project we have created named TestUserTabularProject, now select it and press "OK" to live connect with that tabular project from Power BI.


Now you can see we are live connected and the tables are loaded in the right from the tabular project and also you can see a text saying "Live Connection: Connected" in the bottom right corner in Power BI. 


Limitations of Live Connection

As you can see there is no edit query option when you are live connected also you cannot view the tables or manage their relationships but you can create a new measure which is really useful. The main usage of live connection is to manage a large set of data in faster phase where importing takes too much time.



Comments

Popular posts from this blog

Choosing color scheme for Power BI reports

Choosing beautiful colors for an attention seeking Power BI report is always challenging. Sometimes we may have an important message but it might go unseen if proper color scheme is not used, so it is important to create reports which are informational and visually appealing. In this blog our main objective is to get an idea about selecting appropriate color scheme and tools that can be beneficial to do this. What is a color scheme? As you all know not all colors look great together and you can tell stories by just having only two colors, have a look at the following image, there in the middle you can see a circle with same color and same dimension, only thing that changes is the back ground, but depending on the back ground the way you see those circles are totally different. Some small circles appear softer, some appear sharper, and some are brighter also you might notice movements or depth effect too. It is important to choose colors wisely to serve the purp

Five tips to enhance a tableau model with usability features.

In the previous blogs I was more focused in Power BI since i work with it day to day, but this time we are going to dig into increasing the usability features of tableau. This blog revolves around the end-user simplicity, if a model is hard to comprehend then it will be a disaster, so we should deploy some means to stay simple. So without further ado lets head on to the first topic of the day. Configuring table and  column  properties. A model can consist of many tables but the important fact is they have to be unique and it is better if we can have a table description to elaborate on whats it about. This can be also considered as an internal documentation, when a project member is changed it is easy to pick up and continue. We use connections to load data for the tables and we have a connection name for it but once if we set the source it cannot be changed in the latter part, so be mindful because once you are dropping a connection you are losing all the tables assoc

Ragged hierarchy in Power BI

Case- I have a data set which has to be visualized in a ragged hierarchy. What is ragged hierarchy A ragged hierarchy is a user defined hierarchy with an uneven number of levels.   You can see the above table which has 5 levels of hierarchy. In the first level we only have “World” as a category then moving forward to the next level we have two categories  namely “UK” and “USA” likewise the level of hierarchy is drilling down up to five levels with an uneven amount of categories. Creating a hierarchy in Power BI In the above image  you can notice that I have right clicked the “level 1” column which has to be the first level of our hierarchy, Once it is right clicked there you will notice “New hierarchy” as the second option then you will have to click that in order to create a new one. As you can notice in the above image once I have created a new hierarchy then a new column is created named “Level 1 Hierarchy” in that I have dragged and dro