Press "Enter" to skip to content

Day: April 22, 2024

Getting the Nth Row from a Data Frame

Steven Sanderson takes a slice:

Explanation: – We use nrow(my_df) to get the total number of rows in the data frame. – Then, we use indexing ([nrow(my_df), ]) to extract the last row.

Read on for a simple example of getting the last row using base R, dplyr, and data.table. Then, we kick it up a notch to get the second-to-last row, with the idea being that you could substitute “second-to-last” with any arbitrary number.

Leave a Comment

Enterprise Agreements and Transitioning from Power BI P SKUs to Fabric F SKUs

David Eldersveld talks licensing:

To facilitate a smooth transition from Power BI to Fabric (new capabilities), Microsoft ensured customers could access these new Fabric workloads as well as Copilot for Power BI on their existing Power BI Premium capacity P SKUs.

However, with the introduction of Azure-billed pay-as-you-go and annual reservation F SKUs for Microsoft Fabric, Microsoft recently announced the eventual retirement of the Power BI Premium per capacity SKUs that needs to consider an organization’s Enterprise Agreement (EA) timing.

Read on to learn more, especially if you currently have a Power BI Premium P1 (or higher) SKU.

Leave a Comment

sp_CheckSecurity

Jeff Iannucci announces a new tool:

Maybe you have some scripts you found on the internet to check some SQL Server security settings or look for odd permissions. Or maybe you don’t. Well, sp_CheckSecurity checks about 40 different objects, configurations, and permissions for possible issues. You can read more details about it on the sp_CheckSecurity page.

I’m glad to see a new tool in the security space. Chris Bell used to have sp_woxcompliant when he was still consulting, but that’s lost to history now (though I do have a copy on my PC, as one does). You can run CIS checks in dbachecks and Chrissy LeMaire has a Powershell module for DISA STIG auditing, but I’m not sure how easy that is for a DBA or consultant to use.

H/T Jeff Iannucci, who gave me the friendly reminder to add the blog.

Leave a Comment

Implementing a Star Schema for a Power BI Semantic Model

Nikola Ilic reminds us to keep Ralph Kimball’s Data Warehouse Toolkit book at hand:

But, what is a star schema in the first place? I have good and bad news for you:)…The bad news is: I’m not covering it in this article, because this one focuses on explaining how to implement a star schema in Power BI (assuming that you already know what star schema is). The good news is: I’ve already written about it, so go and read this article first, if you’re not sure what star schema represents in the world of data modeling…

Now, let’s get our hands dirty and build a star schema!

Read on for the demo.

Leave a Comment

Searching for a String Position

Chad Callihan goes index hunting:

SQL Server has the CHARINDEX() and PATINDEX() functions that can both be used to find the position of a value in a string. They each have some differences that make them unique and more fitting for specific situations.

Let’s look at a few examples of how each can be used.

Read on to see how to use CHARINDEX() and PATINDEX() on two statements that are total falsehoods: Kevin Conroy always will be the number 1 and best Batman.

Leave a Comment

Building a Pareto Chart in Power BI

Riqo Chaar get more than 80% of the way there:

The Pareto principle, commonly referred to as the 80/20 rule, is a concept of prioritisation.

It states that for many outcomes, 80% of the outputs are derived from 20% of the inputs. Although this isn’t a universal truth, this pattern has been observed in many different cases. For example, a large proportion (80%) of the revenue a particular business generates may primarily be associated with only a small proportion (20%) of big-selling products. This concept is related to the law of diminishing returns and poses the following question: If, after reaching a certain level of output (80%), significantly more effort is required to achieve further increases in this output, is this additional effort worth it?

In this article, we demonstrate the process (using DAX expressions) of creating a Pareto chart in Power BI.

Read on to see how you can build a chart like this. It’s a very popular style of chart for manufacturing scenarios.

Leave a Comment