Home Business Intelligence Outline a Measure Desk in Energy BI Desktop

Outline a Measure Desk in Energy BI Desktop

0
Outline a Measure Desk in Energy BI Desktop

[ad_1]

On this publish I present you a easy trick to make your Energy BI mannequin extra organised and extra readable. I name it making a “Measure Desk”. Let me clarify. The story is that I used to be engaged on a mannequin with plenty of tables. The database schema was NOT a correct star schema so there have been a bunch of measures unfold into plenty of totally different tables. On high of that we’ve created plenty of calculated measures with totally different residence tables which made it actually onerous to discover a specific measure or calculated measure. I believed, properly, when it’s that onerous to seek out the calculated measures at growth time how onerous it might be for a buyer to seek out, perceive and use the measures we created. The visibility of the calculated measures might be a difficulty when we’ve plenty of measures in plenty of totally different tables. You’ll quickly really feel the difficulty in buyer coaching periods when it’s worthwhile to navigate between plenty of totally different tables to discover a calculated measure.

Take into account you create a Energy BI mannequin with direct hook up with a SSAS Multidimensional occasion. You’ll instantly discover that each one measure teams have a particular calculation icon (Measure Group Icon in Power BI

) slightly than a traditional desk icon (Table icon in Power BI) which makes the measure teams extra recognisable for the top customers. As an example, you may simply discover any calculated measure associated to “Web Gross sales” underneath the “Web Gross sales” measure group.

Measure Groups in SSAS Multidimensional Dirct Connect

I do know, we are able to search and discover the measures very simply, however, our mannequin could be extra organised and extra consumer pleasant if we are able to put all measures in a number of tables which comprise simply associated calculated measures and nothing else. As an example, we are able to create a measure desk for time intelligence calculations and identify it “Gross sales Time Intelligence Measures” and put all  calculated measures like “Gross sales YTD”, “Gross sales LYTD”, “Gross sales Interval Over Interval” on it. It can make your mannequin good and clear, straightforward to make use of and straightforward to be taught to your prospects. It can additionally provide help to to coach your prospects extra simply.

On this article I’ll hook up with a SQL Server occasion and can use the well-known Journey Works database. I additionally present you the best way to get the job accomplished in each “Import” and “DirectQuery” modes as there are some limitations utilized to the DirectQuery mode which makes it more durable to do what we wish.

Lets begin.

The thought is including a brand new desk with only one column having only one worth in that column. Then we have to disguise that column. This makes the entire desk get hidden as there isn’t a columns to indicate. Then we use this desk as “Residence Desk” for all associated calculated measures. Bear in mind, we do NOT disguise the desk, however, simply the column. On this case Energy BI Desktop recognises the desk as a measure desk so it makes use of the measure group icon (Power BI Measure Group Icon) for it.

Create a Measure Desk in Import Mode

  • Open Energy BI Desktop
  • Get information
  • Hook up with a SQL Server Database (Journey Works as a pattern)

Power BI get data from SQL Server 01

  • Choose a desired desk (FactInternetSales in our case)
  • Click on “Choose Associated Tables” button
  • Click on “Load”

Power BI get data from SQL Server 02

  • Click on “Import” then OK

Power BI Get data from SQL Server Import mode

  • Click on “Enter Knowledge” from Residence tab

Power BI Enter Data

  • Enter a price for “Column1”
  • Enter a reputation for the desk then click on “Load”

Power BI Create Table

  • Broaden the brand new desk from the “Fields” pane then disguise the “Column1” column

Power BI hide columns

  • This may disguise the entire desk as there isn’t a seen columns to indicate
  • Click on “New Measure” from “Modeling” tab from the ribbon to create a brand new calculated measure

Power BI new measure

  • Kind a desired DAX expression to make the brand new calculated measure then press enter

Power BI new measure DAX

  • This may create the calculated measure within the first desk within the “Fields” pane

Power BI new measure 02

  • Click on on system bar once more to allow the measure properties
  • Click on “Residence Desk” and decide the newly created desk from the listing

Power BI new measure change home table

  • As you may see the desk seems on the “Fields” pane once more with the calculated measure

Power BI Task pane

  • As you may see the tables nonetheless has the conventional desk icon, however, should you toggle proper the fields pane then toggle left it the icon might be refreshed

Power BI Toggle Task pane

You may create extra tables like “Resellers Gross sales” and so forth then transfer the calculated measures to the corresponding tables. In some circumstances you may disguise the entire truth tables when you’ve got created all calculated measures you want or when your buyer gained’t must see any measures from the actual fact tables.

Power BI Table of Measures

Create a Measure Desk in DirectQuery Mode

Mainly we have to do the identical course of, however, this time we need to hook up with a SL Server database in DirectQuery mode. So to get information we do precisely the identical issues:

Open Energy BI Desktop=> Get Knowledge=> Hook up with a SQL Server database and so forth.

It is necessary that you simply enter the database identify at step one of getting information.

Power BI get data from SQL Server 02

However, you’ll instantly discover that the “Enter Knowledge” button is disabled in DirectQuery mode.

Power BI Enter Data disabled in DirectQuery

It’s OK. There’s at all times another method to obtain the objective.

As I discussed earlier than, we have to enter the database identify when getting information. That is vital as we’ll reuse the connection within the subsequent steps and if we haven’t enter the database identify you’ll get the next message:

“Connecting to tables from multiple database shouldn’t be supported in DirectQuery mode”

Power BI connectin to different datanases is disables in DirectQuery

OK, right here is the trick.

After you related to the SQL Server database in DirectQuery mode comply with the steps beneath:

  • Click on “Edit Queries” from the ribbon

Power BI Edit Query

  • Click on “Current Sources” then click on the latest one

Power BI reuse existing source

  • Choose a desk. It doesn’t matter which desk you choose as we’ll modify it in the course of the subsequent steps. Click on OK

Power BI Navigator

  • This may add the brand new desk within the “Queries” pane (in my pattern it’s “AdventureWorksDWBuildVersion”)

Power BI Query Editor

  • Click on “Superior Editor” from “Residence” tab from the ribbon

Power BI Advanced Editor

Power BI Advanced Editor 02

  • All it’s worthwhile to do is so as to add a easy question like “[Query=”SELECT 1 AS NEW_COLUMN”]” to the supply

Power BI Advanced Editor 03

  • Now it’s a must to remark out/take away the following line in addition to the output within the “in
  • Put “Supply” within the “in” block
  • Don’t forget to take away the comma “,” from the top of the “Supply” line
  • Click on “Finished”

Power BI Advanced Editor 04

  • It’s best to see a desk with one column

Power BI new table in Query Editor

  • Rename the question then click on “Shut & Apply”

Power BI new table in Query Editor 02

OK, now we’ve a desk with only one column. From right here the remainder of the method is rather like what we’ve accomplished earlier than.

Power BI new table in Fields pane

  • Cover the “New_Column” column
  • Add a brand new measure then change the “Residence Desk” to newly created desk
  • Toggle proper and left the duty pane and also you’re accomplished

Power BI Table of Measures 02

You would possibly suppose

“Properly… this was a bit lengthy process. What if I need to create multiple measure desk? Do I must redo the entire course of many times?”

The reply is NO, you do NOT must redo the method for every measure desk you need to add to the mannequin. All it’s worthwhile to do is to create a reference question from the question you already created.

To take action:

  • Click on “Edit Question” from the ribbon to open “Question Editor”

Power BI Edit Queries 02

  • Proper click on on the question you created beforehand and click on “Reference”

Power BI reference table

  • Rename the reference desk then “Shut & Apply”

Power BI reference table 02

  • From right here it’s worthwhile to comply with the identical course of as defined earlier than

Power BI Table of Measures 03

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here