Create Calculated Fields:
Year: Create a calculated field to extract the year from the Order Date field. You can name this field "Year" and use the formula: YEAR([Order Date]). Quarter: Create a calculated field to extract the quarter from the Order Date field. You can name this field "Quarter" and use the formula:
DATETRUNC('quarter', [Order Date]). Month: Create a calculated field to extract the month from the Order Date field. You can name this field "Month" and use the formula: DATETRUNC('month', [Order Date]). SUM(Sales): This is a straightforward aggregation. Create a calculated field named "SUM(Sales)" with the formula: SUM([Sales]). YTD Sales: Create a calculated field for Year-to-Date Sales. You can name this field "YTD Sales" and use a table
calculation to sum the sales for the year. Here's an example formula: WINDOW_SUM(SUM([Sales]), FIRST(), 0) QTD Sales:
Create a calculated field for Quarter-to-Date Sales.
You can name this field "QTD Sales" and use a table calculation to sum the sales for the quarter. Here's an example formula:
WINDOW_SUM(SUM([Sales]), FIRST(), 0) MTD Sales: Create a calculated field for Month-to-Date Sales. You can name this field "MTD Sales" and use a table calculation to sum the sales for the month.
Here's an example formula: WINDOW_SUM(SUM([Sales]), FIRST(), 0) Create a Text Table: Drag the "Year," "Quarter," "Month," "SUM(Sales)," "YTD Sales," "QTD Sales," and "MTD Sales" fields to the Rows and Columns shelf in your worksheet. Filter by Current Year (2023):
Add a filter to your worksheet to filter the data by the year 2023. Format as Needed: Format the table, including number formatting and column headers, to match your desired output.
Now, you should have a text table in Tableau displaying the specified columns with data for the year 2023, including Year, Quarter, Month, SUM(Sales), YTD Sales, QTD Sales, and MTD Sales.
Adjust the filter and formatting options as needed to achieve your desired appearance
Ещё видео!