Press "Enter" to skip to content

Curated SQL Posts

Filtering Power BI Slicers Based on Other Slicers

Matt Allington answers a question:

This is a follow up article from my last blog post where I demonstrated how easy it is to use two slicers to compare any two items. In the demo in my article, I specifically showed how you could compare any 2 years of choice, but the principle applies to any two products, any two customers, or any two of anything. At the bottom of that article, there was a comment from Artur asking if there was a way to limit the choices in the comparison slicer to exclude the item selected in the first slicer. E.g.

If I select Year = 2016 in slicer 1 below, then I don’t want to see Year = 2016 in the comparison slicer 2 below.  I thought that was a great question/suggestion and hence that is the topic for today.

Click through for the video in which Matt answers the question.

Comments closed

Time Series Estimation with Facebook’s Prophet

Dan Lantos looks at the Prophet library:

This article (part of a short series) aims to introduce the Prophet library, discuss it at a high level and run through a basic example of forecasting the FTSE 100 index. Future articles will discuss exactly how Prophet achieves its results, how to interpret the output and how to improve the model.
Please see this article (by my talented colleague Gavita) for an introduction to time-series forecasting algorithms.

Click through for part one in an ongoing series.

Comments closed

Age Calculations in Power BI

Meagan Longoria wants to calculate age:

In week 26 of Workout Wednesday for Power BI, I asked people to calculate the age of Nobel laureates at the time they received the award. I provided some logic, but I didn’t prescribe how to create the age calculation. This inspired a couple of questions and a round of data validation as calculating age may be trickier than you think. In this post, I’ll explore some of the ways people have calculated age in Power BI and the edge cases where those calculations may not work.

In my solution video for Workout Wednesday, I used Power Query to calculate age. This was inspired by several blog posts and videos I had seen previously.

This turns out to be a much trickier problem than it first appears.

Comments closed

The First Partition in a Power BI Dataset Refresh

Chris Webb wants to figure out why the first partition is so special:

It’s a visualisation from a report created by my colleague Phil Seamark (as detailed in this blog post) showing how long all the partitions in a dataset take to refresh. If you look at these visualisations you’ll probably ask the same question I did: why does the first partition always start before the others?

Click through for the answer.

Comments closed

Attaching a Database sans Transaction Log File

Chad Callihan lost a transaction log file in a boating accident:

What if you’re moving a database to a new server by detaching and re-attaching database files and someone (not you of course) loses the log file? What if an old database needs to be brought online but the person coming to you only has an mdf file? Can you still attach the database in these scenarios? Let’s find out.

Read on for the answers.

Comments closed

A Measure of Utilization by SQL Server Version

Steve Stedman some numbers:

Here listed is the current percentages of SQL server versions running our Daily Check-up with Database Health Monitor.

Do note that the population for this is “People who use Steve Steadman’s SQL Daily Checkup product” and not organizations which use SQL Server as a whole, so it’s not wise to apply findings from the first directly onto the second. That said, it doesn’t surprise me that 2016 is the most in-use version of SQL Server in this sample. It’s a little surprising how many 2014 instances there are, but that might be related to cardinality estimator changes.

1 Comment

Font Choices with ggplot2

Kenneth Tay takes us through font options in R’s ggplot2 package:

I was recently asked to convert all the fonts in my ggplot2-generated figures for a paper to Times New Roman. It turns out that this is easy, but it brought up a whole host of questions that I don’t have the full answer to.

If you want to go all out with using custom fonts, I suggest looking into the extrafont and showtext packages. This post will focus on what you can do without importing additional packages.

A quick word of warning: R’s behavior with respect to fonts differs quite a bit between Windows and Mac/Linux. This becomes especially apparent if you do end up installing something like extrafont. H/T R-Bloggers.

Comments closed