Press "Enter" to skip to content

Curated SQL Posts

Roles and Domains in Microsoft Fabric

Marc Lelijveld explains two key concepts:

Microsoft Fabric is out there for a few weeks now. With the release of Fabric, a new concept in line with data-mesh architectures became available in Fabric, or Power BI if you will. With the introduction of Domains, we have a new level of controls added next to existing roles. In this blog I will further elaborate on the levels of control that are available today and provide a clear overview of these different levels.

There’s going to be a bit of nomenclature adjustment for people who have spent most of their time in Synapse or other platforms moving to Fabric. If you’ve already spent most of your time in Power BI, this shift is probably a little easier.

Comments closed

Power BI: Unable to Access the Dataset

Nicky van Vroenhoven troubleshoots an error:

I opened a report with a Live connection to a dataset and I was presented with the error below:

We encountered an error while trying to connect.

Details: “Looks like we’re unable to access the dataset. Please contact the owner of the dataset.”

Read on for the answer to this. And if that doesn’t work, the next question is, do you actually have rights to the dataset?

Comments closed

Identifying Expensive Queries via Query Store

Matthew McGiffen takes a look at what’s slowing down that SQL Server instance:

Some time ago I wrote a query store version of the “Top 20 queries” query that will produce a ranked list of your most expensive queries – and I’ve ended up using this a lot.

The only downside of using the DMVs for Query Store is that they are per database whereas dm_exec_query_stats is a view across the whole instance. So I had to use a cursor and a temp table, populating the temp table for each database in turn.

Click through for the script. This is where having a centralized Query Store, in which you regularly dump Query Store stats from various user databases into your own managed database, could be quite useful.

Comments closed

Automating Azure SQL DB Maintenance Tasks

Tracy Boggiano reminds us that we still need to administer Azure SQL DB databases:

I’ve been using Azure SQL Database for quite some while and have set up it in many various ways to run Ola’s Index Optimize and Statistics Updates on them.  All of these have seemed way too complicated probably because I was setting them up once, not again for several more months or a year.  Well with my new job, I have over 20 subscriptions with various Azure SQL Servers in them so it was time to streamline at least knowing what I was doing.  No matter what I googled on the Internet I never did find one source that walked me step by step on each thing I needed to know to set this up.  So hopefully this will cover everything.

Click through for the step-by-step process.

Comments closed

Unpivoting Data in R

Steven Sanderson shows off a function with a slightly confusing name:

In the world of data analysis and manipulation, tidying and reshaping data is often an essential step. R’s tidyr library provides powerful tools to efficiently transform and reshape data. One such function is pivot_longer(). In this blog post, we’ll explore how pivot_longer() works and demonstrate its usage through several examples. By the end, you’ll have a solid understanding of how to use this function to make your data more manageable and insightful.

The slight confusion is that this function is really unpivoting rather than pivoting. In R terminology, a pivot takes you from longer data to wider data: it uses some function to convert data from N rows * M columns to n*m, where N > n and M < m. Unpivoting does the opposite and I personally like that terminology better than “pivot wider” or “pivot longer.”

Comments closed

Using SHAP to Gauge Geographic Effects in R or Python

Michael Mayer runs an analysis:

This is the next article in our series “Lost in Translation between R and Python”. The aim of this series is to provide high-quality R and Python code to achieve some non-trivial tasks. If you are to learn R, check out the R tab below. Similarly, if you are to learn Python, the Python tab will be your friend.

This post is heavily based on the new {shapviz} vignette.

I appreciate the effort to include both R and Python code in this analysis, and recommend you peruse both sets of code listings.

Comments closed

Creating a Hierarchy for Power BI Field Parameters

Gilbert Quevauvilliers needs a simpler method for navigation:

I was working with a customer where they had a lot of measures which they wanted to use with the awesome Field parameters for measures.

The challenge was that there was a LOT of measures, and I wanted to see if there was a way to create a hierarchy in my field parameters so that it would be easier to find the measure.

Click through to see how you can group field parameters.

Comments closed

Speeding up a Power BI Report via Constant Line

Nikola Ilic tries something different:

Essentially, the idea here is, since these four lines are not changing based on the numbers in the visual itself (they have constant value based on the slicer selection), to leverage the Constant line feature from the Analytics panel. Since no Constant line is available with Line and clustered column chart visual, let’s duplicate our visual and change its type to a regular Clustered column chart.

This is a good reminder that the best outcome isn’t always the most straightforward one.

Comments closed

Updating Database Mail Settings via SP

Chad Callihan doesn’t have time for the UI:

If you need to make changes to multiple servers, you may want to avoid the GUI approach and all of the clicks that come with it. In that case, msdb contains a stored procedure called sysmail_update_account_sp that might be a more efficient approach. Let’s take a quick look at sysmail_update_account_sp and what it can do for you.

Read on to see how the procedure works and what you can do.

Comments closed