Tuesday, June 9, 2020

TSQL Tuesday #127 – Non SQL Tips and tricks

In case you haven't seen T-SQL Tuesday, this is a blog party created by Adam Machanic (b | @AdamMachanic) and now maintained by Steve Jones (b | @way0utwest). Each month someone hosts the party and comes up with a subject for all of us to blog about. Then anyone who is interested gets to blog on this same subject. The host also puts all the post for the month in a recap post.

This month our host is Kenneth Fisqher (the q is silent) (b | @sqlstudent144) and he’d like us to talk about non SQL tips and tricks.


Windows

Task View

I love using Task View, mostly during presentations, but also sometimes during my work when I'm developing.

You can start using Task View by clicking the button somewhere near the Start button. Depending on your settings, the search bar could also be there, or Task View might not be visible at all.


In the latter case, right-click anywhere on the task bar (not on an application) and check Show Task View button.


When you then press the button on the task bar (or WIN + TAB) the Task View opens, where you can add new or delete current Desktops. You can also drag applications from their current Desktop to another one.


As I mentioned I always use this when I'm presenting. I have my regular stuff from work still open in Destkop 1, everything I need for my demo's in Desktop 2 and my presentation in Desktop 3.

This way I can easily switch from my presentation (in presentation mode) to my demo's in Desktop 2 and back to my current slide in the presentation. All without the need to escape out of the presentation (or ALT+TAB and search for the right window) and without the need to start the presentation again after my demo. It's all just waiting there in presentation mode for me to come back! :-) 

If you are also into shortcuts, here are a few, of which the 3rd (switch the desktop) is the most important in my presentations:
  • Task view: WIN + TAB – New Task view opens up and stays open.
  • Create new virtual desktop: WIN + CTRL + D
  • Switch virtual desktop: WIN + CTRL + LEFT or RIGHT
  • Close current virtual desktop: WIN + CTRL + F4

ALT+TAB variant

Ok, I'll be honest, I use ALT+TAB very often. But it turns out there's also an alternative (and more) to that.

  • WIN + [1-9]
  • WIN + SHIFT + [1-9]

WIN + [1-9] switches between applications on the taskbar.

That can mean 2, or actually 3 things:

  • if one or more instances of the application are already open, it will immediately switch to that (first instance of the) app
    • if multiple instance are open, by holding WIN and pressing [1-9] again, it will cycle through the open instances (as long as you hold WIN). On release of WIN it will switch to that (then active) instance. Pressing SHIFT + [1-9] cycles through the open instances in reverse order.
  • if no instance is open yet, it will open an instance of that app
  • if that app is the current active instance, it will be minimized (unless it's a multi-instance app, then it will do nothing :-))
WIN + SHIFT + [1-9] opens a new instance, regardless of now many instances are already open.

Teams

In the current times I'm am using Teams more and more, so I thought I'd also add a few of my favorite shortcuts here:

  • CTRL + Period (.): Bring up all the keyboard shortcuts
  • CTRL + Equals sign (=): Zoom in (for example in a meeting where content is shared)
  • CTRL + Minus sign (-): Zoom out
  • CTRL + [1-6]: Open up the corresponding tab on the left side
  • CTRL + SHIFT + M: Toggle mute in a meeting
  • CTRL + SHIFT + O : Toggle video in a meeting
  • Up arrow: not a shortcut per se, but very handy: if you just typed a message in a chat and press the up arrow afterwards you immediately go to edit mode of that message.
Have a look at all the keyboard shortcuts for Microsoft Teams here, for example also when you're in the Web app instead of the Desktop app.



Sunday, May 31, 2020

Power BI Governance & Administration - Organizational Visuals

As the Power BI Service and Power Platform Administrator at Van Lanschot Kempen I often run into things related to governance and administration of our Power Platform environments. I plan on doing more of these posts, including, but not limited to, the following topics:

  • Workspace upgrade to V2
  • Refresh a dataset with Powershell (and a service principal)
  • Power BI Premium monitoring
  • Workspace and Gateway administration
    • Naming conventions
  • Tenant settings
  • Power Platform environments

If you're interested in any of these or other related topics, please let me know, below in the comments or on Twitter!


Power BI Visuals

Now on to the topic of this post: out-of-the-box, custom & organizational visuals. The main topic of this post will be organizational visuals, but let's start basic and begin with the regular visuals. Because there are quite some out-of-the-box visuals in Power BI, that have a pretty diverse use case.

 


 

Next to all the basic visuals there are also quite some custom visuals in the marketplace, 253 at the time of writing, to be exact.

When you want to use custom visuals in Power BI, please take the following points into consideration:

  • Make sure you trust the author and the source of any custom visual, it can contain code with security or privacy risks.
  • Do you know what data is send over the internet? And where is your data send to?


When to use what visual?

But how do I choose between all these visuals? When do I prefer a line chart over a table visual or a pie chart? Well, the answer to the last one is simple: don't use pie charts. Like never. Even Wikipedia mentions many experts recommend avoiding them, among which Stephen Few.

 

Now we're clear on that, let's look at a few examples of how to choose the best chart/visual for your data:


Organizational visuals

At Van Lanschot Kempen, in the end of last year we introduced the use of Organizational visuals. This allowed us to deploy and manage Power BI visuals inside our organization. The mean reason for us for doing this was to block all, except the certified custom visuals, mainly because:

  • The Admin can control which custom visuals are available in the organization
  • Better security as those visuals will only be allowed for organizational members that are logged in
  • No need to share visual files (when using private visuals)
  • Everyone uses the same visual version (controlled by the Admin)

 

Tenant settings

In the Power BI Admin portal there are 2 Tenant settings that you can use to adjust the use of custom visuals to the needs of your organization. Because by default all members of an organization can add and use all Power BI visuals including imported private files.

 



If you think these settings were previously called different, that's correct. I believe they renamed them last week, this were the old names for the settings:



 

The 2 settings are used as follows:

  • Allow visuals created using the Power BI SDK
Pretty straight forward: allow or disallow the use of custom visuals, either for everyone or (not) for specific security groups

 


 

  • Add and use certified visuals only (block uncertified)
If the first setting is enabled, you can either enable or disable this setting.

 


 

Please be aware that when you enable this (last) setting, all uncertified visuals in current reports will be blocked (in the service). Enabling the visual through the Organizational Store again doesn't help, because in that case the visual uses another ID, as you will see later in this post.

 

In addition to blocking the use of certain visuals in the Service, Power BI Desktop supports using a Group Policy to apply these 2 settings also locally:

  • EnableCustomVisuals
  • EnableUncertifiedVisuals

You can read how to exactly enable this setting in the PowerBI visuals settings of the Admin Portal documentation.


Organizational visual administration

The organizational visuals can be managed from the Admin Portal.

An important note: organizational visuals are visuals that are handpicked and managed by the admin. None of the Tenant settings above are applied to the organizational store. Disabling the visuals in the organizational store must be done manually by the admin in the Admin Portal.

These are the organizational visuals we currently have deployed in our tenant:

 


 

As you see we also have the Hierarchy Slicer (by Jan Pieter Posthuma), because at the time we implemented that visual into the organizational store, it wasn't certified yet (it was certified on January 7, 2020). We still have to do an impact analysis to see if we can switch back to the regular (certified) visual, because then it will update itself again via the regular visuals store and can also be exported to Power Point for example.

 

 

Adding organizational visuals

In the Power BI Admin Portal you can Add an organizational visual in the Organizational visuals section.

You can provide the following properties for a visual:

  • .pbiviz file (mandatory): you can download this file from AppSource.
  • Name: You can give it any name you want, just be aware this name is not used as the name of your visual in Power BI Desktop, only in the My organization tab in Power BI Desktop
  • Icon: Again, this is only the icon displayed on the My organization tab in Power BI Desktop, the icon in the  visualizations pane is still managed by the .pbiviz file.
  • Description: duh :-)
  • Access: you have the possibility to disable a visual currently deployed to the organizational store.

 


 

For more information on adding an organization visual please visit Add a new custom visual.


Using Organizational Visuals

As I mentioned earlier, when you are using organizational visuals they are different from the "regular" visual with the same name. They are managed in the Admin Portal and have a different ID from their regular counterpart. You can check this in Power BI Desktop if you right-click a visual in the visualizations pane.

 

Organizational visual


 

Regular visual, tied to AppSource

 

Now when I publish this report to the service I will see the following error on my report:



Recap and limitations

There are quite some Power BI visuals available for you to use: be it out-of-the-box, custom or organizational visuals. However, you can have good reasons not to open up the world for the Power BI report authors, so you start with taking a look at the Tenant settings.

Don't forget to plan for updating the used organizational visuals and communicating to the organization you're limiting the use of certain visuals for the end users.

 

Also, you might want to take a look at a few important limitations mentioned in the documentation, of which I'd like to highlight the following:

  • If a custom visual is deleted from the repository, any existing reports that use the deleted visual will stop rendering. Deletion operation from the repository isn't reversible. To temporarily disable a custom visual, use the "Disable" feature.
  • Organizational Power BI visuals are private visuals imported from the organization repository. As any private visual they can't be exported to PowerPoint or displayed in emails received when a user subscribes to report pages. Only certified Power BI visuals imported directly from the marketplace supports these features.

Resources and further reading:

Wednesday, April 15, 2020

Installing the PowerShell Power BI Management cmdlets


So I thought this would be a pretty straightforward task. But because I wrote this short post you probably figured out I ran into a couple of issues trying to install the Power BI Management commands for PowerShell.
I should also mention that I think I can say I'm pretty proficient at using the Power Platform products, but I'm still a beginner in the PowerShell world :-)

Prerequisites

For starters, keep in mind the supported environments and PowerShell versions, luckily I met those:
  • Windows PowerShell v3.0 and up with .NET 4.7.1 or above
  • PowerShell Core (v6) and up on any OS platform supported by PowerShell Core

Older versions of MicrosoftPowerBIMgmt

The first hurdle I encountered was the fact that there was already an older version installed. After some fiddling, trying to uninstall the old modules and going through the fixed described below, I figured the documentation was probably the best start, and it was. :-)
You can update to the latest version of the Power BI Management module with the following command:
Update-Module -Name MicrosoftPowerBIMgmt

If you want to uninstall all the Power BI PowerShell cmdlets, run the following in an elevated PowerShell session:
Get-Module MicrosoftPowerBIMgmt* -ListAvailable | Uninstall-Module -Force

Untrusted Repository

The second thing that hit me was this message that kept coming back about an untrusted repository PSGallery.


After some searching I found this blog that has a nice solution: adding the PSGallery to the trusted repositories will get rid of the necessary annoying pop-up:
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted

Install-Module

I thought I could finally get around to installing the desired module, but unfortunately I ran into another error:

I also tried installing only the Profile cmdlet, but that didn't help and turned up the same warning error.

Going to the link provided for the Source Location actually downloaded the NuGet-package, so the URL seemed valid, just not in PowerShell.

Another Google search got me the solution. Apparently switching to TLS 1.2 solves the problem, so I did:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12


Now I can finally get around to searching for one of my workspaces with PowerShell :-)


Tuesday, March 31, 2020

My First Look at Read/Write XMLA Endpoints in Power BI Premium

Exactly 1 year ago Microsoft announced the public preview of PowerBI open-platform connectivity with XMLA endpoints. That allowed us to connect to Power BI Premium datasets with external tools, like SSDT, SSMS, SQL Server Profiler and DAX Studio.



On March 26, they took the next step and announced the public preview of read/write XMLA endpoints in Power BI Premium.
You can go to the link of the webinar to re-view the session given by Christian Wade last week.

Theory

If you just want to see read/write XMLA endpoints in action, skip to the Practice section of this post.
Otherwise, if you never heard of it or just wanna read up on the specifics, keep reading here and we'll get there eventually :-)

Preview Feature

To start with a side-note disclaimer:




XMLA Endpoint

If you're not familiar with XMLA, you can read all about it at the XML for Analysis (XMLA) Reference. Basically, it's the protocol for communicating between client applications and the engine that manages the workspaces and datasets.
These communications are through what are commonly referred to as XMLA endpoints. XMLA is the same communication protocol used by the Microsoft Analysis Services engine, which under the hood, runs Power BI's semantic modeling, governance, lifecycle, and data management.

Additional Functionality

Through these endpoints, Visual Studio and open source community tools like Tabular Editor are enabled to provide additional data modeling and deployment capabilities (supported by the Analysis Services engine, but not yet in Power BI Desktop), like:

Enable Read Write

Follow the steps outlined here to enable XMLA Read Write in the Power BI Admin Portal for your Premium capacity.



In Practice

To test the new read-write functionality I started with an existing Tabular project in Visual Studio (SSDT) and see if I can deploy this to a Power BI Premium workspace. This project currently has a compatibility level of SQL Server 2014 (1103).





One thing to remember is the current SSAS-version of my localhost, this is 1400. We'll come back to this later, as it seemed rather important…





Upgrade Existing Model

So I started with opening the model (.bim-file) to change it to SQL Server 2019 / Azure Analysis Services (1500).
That leaves me with the following error:





A bit strange at first, because I don't know why this wouldn't be possible. I tried upgrading one compat-level at a time. 1200 worked fine, as did 1400. But 1500 kept failing. Then it struck me that I set up the Workspace Server to my localhost, which is level 1400.
So to fix this, in the properties of the model, I changed the setting Integrated Workspace Mode to True. And after that I could change the compatibilitiy level to 1500.




If you haven't disabled the pop-up, you can also set this at the startup of your project:




Deploy to Premium Workspace

If you don't know yet how to connect to a workspace on a dedicated capacity read up on it here and then come back. In the properties of the project file you can set the Deployment Server to the Power BI URL of your workspace.




Security

In addition to the XMLA Endpoint property being enabled to read-write by the capacity admin, the tenant-level Export data setting in the Power BI Admin Portal, also required for Analyze in Excel, must be enabled.
Furthermore, it's good to know that when accessing workspaces through the XMLA endpoint, group memberships (workspace and app access rights) are still honored.
The highest access rights that are currently possible are equivalent to Analysis Services database admins. So anything that requires server admin permissions (server-level traces, certain DMVs) is not yet supported through XMLA endpoints.

Model Roles

When I started my deployment I ran the following error:





As stated in the docs, the following limitations apply when working with dataset roles through the XMLA endpoint:
  • During the public preview, you cannot specify role membership for a dataset by using the XMLA endpoint. Instead, specify role members on the Row-Level Security page for a dataset in the Power BI service.
  • The only permission for a role that can be set for Power BI datasets is the Read permission. Build permission for a dataset is required for read access through the XMLA endpoint, regardless of the existence of dataset roles. Use the Power BI security model to control permissions beyond RLS.
  • Object-level security (OLS) rules are not currently supported in Power BI.

Obviously, I ran into the first point. And it turns out I had 3 XMLA-scripts for role assignments in my project, which are not supported yet in preview mode, as also explained here. I had to delete the defined roles in my model itself, as shown here:




Success (sort of)

After fixing the roles I tried to deploy again and I got myself a little cheer, because the metadata was successfully deployed! However, I was seeing some errors at the table level of the deployment.





Looking at the error details quickly showed me what is was, because I read that, again, in the docs:

When deployed the first time, a dataset is created in the workspace by using metadata from the model.bim. As part of the deployment operation, after the dataset has been created in the workspace from model metadata, processing to load data into the dataset from data sources will fail.





So looking at the Power BI workspace, we can already see the dataset appearing there!





The error is now with the credentials of the dataset. So configuring the dataset settings in the Power BI Service will solve this. Depending on the data source you can either:
  • Set data source credentials
  • Configure the dataset to use the data gateway

Downloading the PBIX file

There's one more thing I'd like to mention, which is also noted in the docs, but very important to know:
At this time, a write operation on a dataset authored in Power BI Desktop will prevent it from being downloaded back as a PBIX file. This will result in the following error in the Power BI Service:




Closing

I also did some tests with another project and got into some other errors. But this post is already getting very long, so I'm first going to investigate these errors and see if I can find an explanation for them to pop up.
Also remember once again, this feature is still in public preview, so it should not be used in a production environment. It is scheduled to be in GA in September 2020 according to the current release plan.

All-in all I think this is an awesome feature that will give us many more capabilities, especially regarding metadata of a dataset. And I only used SSDT and SSMS to connect to and deploy my dataset, but there are a lot of other options available that you can use.
The error messages I received could have been a bit more descriptive, but I heard (from a very good source) that the Power BI team is already working on that!

So to recapitulate, a few important points to notice in the end:
  • Go read the documentation first 
  • Enable Read Write for XMLA Endpoints at your Premium Capacity
  • Enable the Export data setting in the Power BI Admin Portal
  • Make sure your localhost is compat level 1500 or use the Integrated Workspace Mode
  • Delete any role memberships in your model during the public preview
  • A write operation on a dataset will prevent it from being downloaded back as a PBIX file
  • Did I already mention it is still a preview feature? :-)

Did you already have a start with XMLA endpoints, being the recently released read and write feature, or the read-only feature? Please let me know what you think and also what things could be improved even further?


Featured Post

Power Apps or Translytical Task Flows?

I think I have gotten this question at least five or six times in the last few months, and with Translytical Task Flows reaching GA in the M...