Month: June 2020

  • Buy and Apply Power BI Premium P license

    Buy and Apply Power BI Premium P license

    I am working on a project that uses Power BI embedded to display reports to external users via an application. I’ve used the progression of A sku’s (embedded license via Azure) to support the various reports. I love using the A sku for various reasons, it has a low point of entry offered in the A1. It is easy to scale up to the higher tiers as I need to. It has the ability to pause a capacity at any time. I also enjoy the flexibility of pay-by-the-hour the license provides. However, I just got to the point where one of our capacities is about to exceed the 10GB of RAM I get on the A3. As a result, I started to compare the A4 sku to the P1 sku. They are the same in terms of cores and RAM (8/25), but the P1 has an option to be cheaper.

    After researching how to buy and apply the Premium P license I realized there wasn’t an end to end explanation of what to expect and how to apply the P sku to my specific region. This is hugely important in order for some of the Service features to work correctly. When committing to large sums of money, I find its always nice to have these answers up front, so I hope the following walk through helps those decision makers out there.

    Analyze the A sku

    Before we jump into the P sku, lets take a quick moment to see how an A sku is purchased in Azure. There is documentation out there that explains how to sign up for Premium and includes the A sku in Azure. That can be found here ( https://docs.microsoft.com/en-us/power-bi/admin/service-admin-premium-purchase). However, I want to highlight the two areas that most interest me, that I couldn’t find answers too when trying to commit to buying the P sku. There are two key areas that I care about the most with this purchase. The first, is the location of the capacity (region). Second is who gets assigned as a capacity administrator. When you purchase the A sku, those are front and center. As a result, the license purchase is an easy process because I select them prior to committing any money.

    Purchase the P sku

    Unlike the A sku, you purchase the P sku in the Office 365 admin center. The glaring difference from the experience with the A sku is that you purchase the P1 license without any configuration… This can cause a bit of heartburn if you need to ensure that the capacity is applied to the right region upon purchase. For the moment, you can just assume things will come out smelling like roses and move on to the steps to purchase the P1 license. In the O365 Admin Center under Billing you will Select Purchase Services and then Search for Power BI. This pulls up the list of licenses you can choose from and you are going to Select the Power BI Premium P license.

    Selecting the license presents you with the options for payment type.

    Here is where we see the much cheaper price of $4,995.00, but it comes with the yearly commitment. (As a side note, I really wish we had the yearly commitment option with the A sku, with that option available, I wouldn’t even have to muck around with the P sku for my implementation.)

    After you complete the purchase process you can navigate to Purchase Services again and see that the Power BI Premium P license is now active.

    Assign and Configure on Setup

    Now what?

    Well, all you saavy Power BI Admins, we head over to the Power BI Service of course!

    Log in to your Service (app.powerbi.com) and because you’re all Global Administrators or Power BI Administrators you have access to the Admin Portal. For you first timers, that would be under

    Settings > Admin Portal

    (If you do not see the admin portal you will need to contact your IT or Security guys to grant you the Power BI Administrator Role.)

    Now normally when you go into the portal you would see a page that looks like this under Capacity settings.

    But after you purchase the license, in O365, and come back to the Power BI Service you will see this the first time you log in.

    Click on the Set up new capacity button and you get to the screen that myself and all of you wanted to see from the start. Where you add any additional capacity administrators as well as which region you want to use for your capacity.

    As the gray box outlines for you, the initial region is the home region of the Power BI tenant, but Clicking on the Region pops up all the other regions you can choose from.

    Make your selections. All that remains to be done is Clicking on the Set up button. Now your capacity is provisioned based on your configuration settings.

    Your new view when you log in to work with your capacity looks like this. You’ll be back often to monitor and alter any capacity configurations.

    Apply Capacity to Workspace

    I’ll close this out by showing you the final step of how you apply that new capacity to your workspaces.

    Jump back out into the home screen by Clicking Power BI in the upper left hand corner of the browser.

    Click on Workspaces and hover over the workspace that you want to add to the capacity.

    Click on the ellipses (3 dots) that appear to the far right and Select Workspace settings.

    The Settings dialogue will appear on the right hand side and you will Click on Premium in the header. Give the application a moment and you will be able to toggle the Dedicated capacity to On

    In the dialogue, Select the newly provisioned capacity and Click on Save.

    You will now see a little diamond next to your workspace name.

    After all that, you now have a Premium P license capacity supporting the datasets and reports in that workspace.

    Wrap Up

    I had too many unresolved questions during this process. I was looking for something like this blog to assure me I was headed in the right direction. Since I didn’t find it, I decided to write up my experience. I want to make sure others with those same questions can to see what it looks like to go through the process from an end to end. Hopefully this perspective helps when making the leap into Power BI Premium P1 licensing.

    If you like the content from PowerBI.Tips, please follow us on all the social outlets to stay up to date on all the latest features and free tutorials.  Subscribe to our YouTube Channel, and follow us on Twitter where we will post all the announcements for new tutorials and content. Alternatively, you can catch us on LinkedIn (Seth) LinkedIn (Mike) where we will post all the announcements for new tutorials and content.

    As always, you’ll find the coolest PowerBI.tips SWAG in our store. Check out all the fun PowerBI.tips clothing and products:
    Store Merchandise

  • Split an existing Power BI file into a model and report

    Split an existing Power BI file into a model and report

    Shared datasets are a great way to share data models across the organization. This enables users to maintain one source of the truth and increase efficiency. However, models should be built separate to reports. Meaning it can be difficult to transform an existing report into a shared dataset.

    This post describes how to split a pbix file with report and model, into two separate files One for the model and one for the report. This is accomplished using a PowerShell Script. By using this technique any report can quickly be split into a data model file and live connection report file.

    Note: that this script is not officially supported by Microsoft. This code is provided as is without any guarantees. The code will alter the internal files, so please keep a backup if you are unsure of anything.

    Think like the Business, Act like I.T

    Being a great Power BI developer can often mean more than just building visually impressive reports. Focus should be given to efficiency, reusing design and data modelling where possible. In addition, there should be “one source of the truth” – different reports should not have different methods to calculate the same KPI.

    This is accomplished by the creation of Shared Datasets. Users can publish a report that contains no visuals, only a data model. Multiple reports can then be built off this model by using a live connection and use the same data model. The model contains global measures. A Global measure is written and stored in the model file. Then the Global measures are re-used by other reports via the Live Connection. This ensures all reports have the same data model, logic and refresh status.

    There are many reasons you should consider this approach, which is out of scope for this article. If you are less familiar with shared datasets, I encourage you to visit the following resources:

    Think like the Business, Act like I.T user group – global models

    Power BI datasets: A Method to the Madness article

    Planning A Power BI Enterprise Deployment whitepaper DOWNLOAD
    ( Chris Webb and Melissa Coates) – section 9

    Use Cases

    Shared datasets are great, but what if you already have a file with a model and report in one? Currently in order to split a file this would need to be manual, by either copying all the visuals over to a new report (you would also need to re-record any bookmarks, filters, layouts etc. ) or to copy all the Power Query queries (you would then need to set up relationships and re write all measures). This can be time consuming, especially on a large report or model.

    Luckily for you, this code will do all the hard work for you. Simply run the code and select a PBIX file. It will create two new files, a report and a model.

    Running the code

    Right click and select the option Run with PowerShell in the menu.

    A menu will open up. Select the power bi file that you wish to split.

    Click the button OPEN to allow the script to modify your file.

    The script will then create two copies of the file and add the suffix _model and _report. Feel free to rename these, if you desire.

    Publishing to the Service

    Model File

    Open the _model file. It’s a good idea to add some text to the report explaining this is only a model file, so others understand the purpose. Example:

    Publish this file to the desired workspace.

    Report File

    Open the _report file. The script will leave all visualizations and report features intact, but all connections will be removed. When you open the report in power bi desktop, all visuals will appear broken:

    If prompted, make sure you discard changes – this will completely detach the report from the source.


    Click Get Data and Select Power BI Datasets.

    In the pop up window, select the model report you published in the previous step. This will now restore all visuals to display again.

    Publish the report to the desired location.

    That’s it! you can now share your new model file and continue to build reports off it.

    Download the Script

    You can download the script described below

    Download the PowerShell file and save it to your local machine.

    Script

    #This script was designed by Steve Campbell and provided by PowerBI.tips
    #BE WARNED this will alter Power BI files so please make sure you know what you are doing, and always back up your files!
    #This is not supported by Microsoft and changes to future file structures could cause this code to break
    
    #--------------- Released 6/2/2020 ---------------
    #--- By Steve Campbell provided by PowerBI.tips ---
    
    
    #Choose pbix funtion
    Function Get-FileName($initialDirectory)
    {
        [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") | Out-Null
        
        $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
        $OpenFileDialog.initialDirectory = $initialDirectory
        $OpenFileDialog.filter = "PBIX (*.pbix)| *.pbix"
        $OpenFileDialog.ShowDialog() | Out-Null
        $OpenFileDialog.filename
    }
    
    
    #Error check function
    function IsFileLocked([string]$filePath){
        Rename-Item $filePath $filePath -ErrorVariable errs -ErrorAction SilentlyContinue
        return ($errs.Count -ne 0)
    }
    
    
    #Function to Modify files
    Function Modify-PBIX([string]$inputpath, [string[]]$filestoremove){
    
        #Make temp folder
        $temppth = $env:TEMP  + "\PBI TEMP"
        If(!(test-path $temppth))
        {New-Item -ItemType Directory -Force -Path $temppth}
    
        #Unpackage pbix
        $zipfile = ($inputpath).Substring(0,($inputpath).Length-4) + "zip"
        Rename-Item -Path $inputpath -NewName  $zipfile
                  
        #Initialise object
        $ShellApp = New-Object -COM 'Shell.Application'
        $InputZipFile = $ShellApp.NameSpace( $zipfile )
    
        #Move files to temp
        foreach ($fn in $filestoremove){ 
           $InputZipFile.Items() | ? {  ($_.Name -eq $fn) }  | % {
           $ShellApp.NameSpace($temppth).MoveHere($_)   }  
        }
        
        #Delete temp
        Remove-Item ($temppth) -Recurse
        
        #Repackage 
        Rename-Item -Path $zipfile -NewName $inputpath  
    }
    
    
    
    
    #Choose file
    try {$pathn = Get-FileName}
    catch { "Incompatible File" }
    
    
    #Check for errors
    If([string]::IsNullOrEmpty($pathn )){            
        exit } 
    
    elseif ( IsFileLocked($pathn) ){
        exit } 
    
    #Run Script
    else{    
    
        #set variables
        $modelfiles   = @( 'SecurityBindings', 'Report')
        $reportfiles   = @('Connections','DataModel',  'SecurityBindings')
        
        #Copy files
        $pathf = Get-ChildItem $pathn
        $reportname = [io.path]::GetFileNameWithoutExtension($pathn)
        $model = ($pathf).toString().Replace('.pbix', '_model.pbix')
        $report = ($pathf).toString().Replace('.pbix', '_report.pbix')    
        Copy-Item $pathn -Destination $model
        Copy-Item $pathn -Destination $report
    
        #modify files
        Modify-PBIX $model $modelfiles
        Modify-PBIX $report $reportfiles
        
    }
    
    
    

    Script Usage License

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    If you like the content from PowerBI.Tips please follow us on all the social outlets. Stay up to date on all the latest features and free tutorials.  Subscribe to our YouTube Channel.  Or follow us on the social channels, Twitter and LinkedIn where we will post all the announcements for new tutorials and content.

    Introducing our PowerBI.tips SWAG store. Check out all the fun PowerBI.tips clothing and products:

    Check out the new Merch!

    Hasta La Vista Data
    Go Ahead Make My Data
    PBIX Hat


  • Model Performance in DAX Studio

    Model Performance in DAX Studio

    Understand more about your model then you thought possible! This is part two in our series on DAX Studio. If you missed part one be sure to check out the Introduction to DAX Studio.
    In this session Marco Russo shares the fundamentals for model performance in DAX Studio and dives into key areas that you absolutely need to understand. Marco is an accomplished trainer and you won’t find a better resource to guide you on this journey.

    Using DAX Studio in conjunction with Vertipaq Analyzer Marco shows us how we can discover and explore the key statistics about our models.
    Use Vertipaq Analyzer against your open Power BI model or any tabular model. This tool only exports the tabular metadata, not the data! So we can do offline analysis on a model we don’t have access to by having people with permissions export these metrics. Better yet, we can download this into Excel and everything gets broken down for you all the way to your relationships and measures… AMAZING!

    If you like the content from PowerBI.Tips, please follow us on all the social outlets to stay up to date on all the latest features and free tutorials.  Subscribe to our YouTube Channel, and follow us on Twitter where we will post all the announcements for new tutorials and content. Alternatively, you can catch us on LinkedIn (Seth) LinkedIn (Mike) where we will post all the announcements for new tutorials and content.

    As always, you’ll find the coolest PowerBI.tips SWAG in our store. Check out all the fun PowerBI.tips clothing and products:
    Store Merchandise