Press "Enter" to skip to content

Author: Kevin Feasel

Retrieving Power BI Licenses in a Tenant

Gilbert Quevauvilliers wants to figure out who has licenses:

In this blog post I am going to show you how to get all the Power BI licenses in your tenant.

This can be very useful to understand how many licenses you have, what type of licenses are being paid for, and potentially how you can save by removing licenses due to inactive use or if the licenses are no longer required.

I’m going to be pulling on my previous Blog post where I explained how to get the Entra ID users and groups using a Service Principal for access

Click through for the demonstration.

Leave a Comment

Top 6 Things Microsoft Ever Did to SQL Server

Brent Ozar has a list:

This entire blog post is driven by the #1 feature in this list. I think about the #1 feature a lot, like at least once a week. I think about it so much that I had to stop and think about what other similar great things Microsoft has done over the years, and be thankful for what a nice platform this is to work with. Let’s go through 6 of my favorite Microsoft decisions.

I have to warn you: some of my takes are weird.

English Query was definitely an idea before its time. It was a great idea that I’m sure demoed well (though that was before I got into SQL Server, so can’t tell you from personal experience), but it was dog slow.

Read on for the rest of the list. Admittedly, sometimes I wish Microsoft had gone through on its deprecation notice around statements not ending in a semi-colon, just to watch the world burn.

Leave a Comment

Brownfield Data Modeling

Jared Westover discusses a common trade-off:

Some decisions in life are easy, like whether to drink that second cup of coffee. But when it comes to databases, things get complicated fast. Developers often seek my input on adding tables and columns. A common question arises: Should they create a new table or expand an existing one by adding columns? This decision can be tricky because it depends on several factors, including query performance, future growth, and the complexity of implementing either solution. While adding one or two columns to an existing table may seem the easiest option, is it the best long-term solution? In this article, we look at whether it is better to add new columns versus a new table in SQL Server.

As an architectural pro-tip, when you’re looking to add a new column to an existing table, ask yourself if the new attribute you want to add actually relates to the natural key of the existing table. In Jared’s example, the natural key for video game tracker is presumably video game ID (which itself ties back to, presumably, the video game title, developer, console, and release date) and start date. Does a book actually relate to a video game and start date? No, it does not. Therefore, this book attribute does not belong on the video game tracker table.

When you dig deeper into Boyce-Codd Normal Form, you figure out that “relates to” in the prior paragraph translates to “has a functional dependency upon,” but using non-technical language for people not familiar with normalization, you can still get to the same conclusion, because ultimately, 95% of database normalization is common sense that we strenuously apply to a business domain.

And most of the time, the developer knows that this feels weird, but doesn’t want to spend the extra time doing it the best way and instead tries to do it the expedient way. This is where the role of the architect as politician comes in, and we gently guide people to the right conclusion. Or just tell them to put on their big boy britches and do it right. Either way.

Leave a Comment

The Logic behind RIGHT OUTER JOIN

Constantine Kokkinos provides an explanation:

I was talking to a friend of mine and they are learning some SQL and they said something that I have seen come up multiple times in learning SQL.

They said “Yeah, I need to study the join types more. They make sense to me but I want to be able to not reference my notes” and also “I don’t really get the point of a right join if your can do the same thing with a left join by just switching the table name.”

These are great points, and common questions that occur when first learning SQL.

I won’t steal CK’s thunder (too much) about how we express joins in set theory, though I think when he mentions “OUTER” as a type of join, perhaps that’s supposed to be FULL OUTER JOIN?

Regardless, my take: there is a good reason to use INNER JOIN. There is a good reason to use LEFT OUTER JOIN. There is a good reason to use CROSS JOIN. There is a good reason to use FULL OUTER JOIN. The frequency in which you should use each is in descending order, meaning that there are relatively few circumstances in which you should use a FULL OUTER JOIN, but they do exist.

There are no good circumstances for a RIGHT OUTER JOIN. The concept logically exists, but has no practical value to us.

Leave a Comment

Alternatives to Error Bars

Alex Velez admits to error:

During a client workshop, someone asked me if I was a fan of error bars and whether they should use them in their presentations. As I readied my standard “it depends” response, I realized that for once, it didn’t depend. I couldn’t think of a single time when error bars would be the ideal solution for communicating data. (For clarity, if they had asked whether they should articulate the margin of error around their data, my answer would have certainly been it depends. I just wouldn’t use error bars to do so.)

Before I discuss why I’m not a fan of error bars and an alternative solution, let’s explore what they are. 

Click through for Alex’s thoughts, including a pair of interesting alternative displays.

Leave a Comment

Indexing a Materialized View in PostgreSQL

Elizabeth Christensen adds an index:

Materialized views are widely used in Postgres today. Many of us are working with using connected systems through foreign data wrappers, separate analytics systems like data warehouses, and merging data from different locations with Postgres queries. Materialized views let you precompile a query or partial table, for both local and remote data. Materialized views are static and have to be refreshed.

One of the things that can be really important for using materialized views efficiently is indexing.

Adding indexes to Postgres in general is critical for operation and query performance. Adding indexes for materialized views is also generally recommended for a few different reasons.

Click through for those reasons. This article illustrates some of the differences between indexed views in SQL Server and materialized views in PostgreSQL.

Leave a Comment

Choosing the Right Power BI Canvas

Elena Drakulevska shares some advice:

The same goes for your Power BI report—get the size wrong, and your users will struggle with cluttered visuals, excessive scrolling, or awkward gaps. Or worse, you’ll create a report that looks amazing on your screen but completely breaks when someone else opens it.

Trust me, I’ve seen it—an ultrawide masterpiece designed for the boss’s fancy monitor… except no one else at the company had that monitor.

Yeah, this brings back memories, though in my case, it was that the developers (including me) had wide-screen monitors in 1080p and the people using our product had standard resolutions like 1280×1024 or even 1024×768.

Leave a Comment

What to Do when SQL Server Ignores Your Non-Clustered Index

Mehdi Ghapanvari wants us to think of the poor, downtrodden non-clustered indexes:

Do you wonder why SQL Server ignores an index? Do you think about how you can deal with this problem? When you include too many columns in a query you decrease index selectivity. So, if you write a query like “Select * From …” the chance of choosing your nonclustered index will decrease.

The article is generally sound, though not all-inclusive. If you really want to use an index, you can use index hints. I personally have no qualms about using them, though hints are telling the optimizer that you know better than it, so be really sure you do actually know better than it before shipping that off.

Leave a Comment

Reducing Query Timeout on DAX and MDX Queries

Chris Webb shuts it down:

The recent announcement of Surge Protection gives Fabric/Power BI capacity admins a way to restrict the impact of background operations on a capacity, preventing them from causing throttling. However, at the time of writing, Surge Protection does not prevent users that are running expensive DAX or MDX queries – which are interactive operations – from causing problems on your capacity. Indeed, right now, there is no direct way to stop runaway queries from consuming a lot of CUs, although there is something you can do which will help a lot: reducing the query timeout.

Read on for information about why Surge Protection doesn’t currently work with DAX and MDX queries, and how you can change the query timeout. This is kind of interesting considering that, outside of the Microsoft Fabric world, we typically move the query timeout higher rather than lower, to deal with long-running queries.

Leave a Comment

Billing for SQL Database in Microsoft Fabric

Amar Digamber Patil makes an announcement:

Since SQL database is a native item in Fabric, it utilizes Fabric capacity units like other Fabric workloads. Compute charges apply only when the database is actively used, so you only consume what you need. Storage is billed separately on a monthly basis, as are automatic backups, which are retained for seven days.

Billing for compute usage and data storage for SQL databases in Fabric will commence after February 1st.

Click through for more information, including links to more information regarding billing and monitoring.

Leave a Comment