September 12, 2023
How to Calculate Weekday-Only Sales in Tableau
Have you ever wondered how to compare sales performance between two sets of weekdays?
In this video, I'll show you how to calculate and compare sales for the last 10 weekdays against the prior 10 weekdays—all while excluding weekends.
What You Will Learn:
- Setting up your data source for comparison
- Creating calculated fields for two sets of weekdays
- Configuring table calculations to get only the days you need
- Filtering out weekends from both data sets
- Implementing advanced date functions for comparison
- Visualizing and comparing sales for both sets of weekdays
Background Context:
Tableau enables you to conduct intricate data analyses, but comparing specific sets of weekdays can be tricky. This tutorial simplifies that process, focusing on comparing the last 10 weekdays' sales with the 10 weekdays preceding them.
Assumptions:
- You have a foundational knowledge of Tableau.
- Your sales data contains date information.
- You've previously worked with calculated fields in Tableau.
Related Videos:
Resources:
- Workbook & data: Link
January 31, 2023
How to Calculate Day over Day Change Excluding Weekends
In a previous tip, I showed you how to calculate day over day change and build 3 KPI cards.
However, this does not cover the case when you need to ignore weekends. In this #Tableau tip, I show you how to calculate daily change excluding the weekends.
You can copy/paste the calculations from below the video. Enjoy and good luck!
Calculations
- Latest Day
{MAX([Order Date])} - Weekday for Latest Day
DATEPART('weekday',[1. Latest Day]) - Sales for Latest Day
INT([Order Date]=[1. Latest Day])*[Sales] - Previous Day
IF [2. Weekday for Latest Day]=2
THEN [1. Latest Day]-3
ELSE [1. Latest Day]-1
END - Sales for Previous Day
INT([Order Date]=[4. Previous Day])*[Sales] - DoD Change
SUM([3. Sales for Latest Day])-SUM([5. Sales for Previous Day]) - DoD Change %
[6. DoD Change]/SUM([5. Sales for Previous Day]) - Positive Change
[7. DoD Change %]>0