> For the complete documentation index, see [llms.txt](https://docs.infotopics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infotopics.com/powerkpis/features/style-kpi-cards/global-settings/dates.md).

# Dates

A few date setting can be changes in the **Dates** section.

<figure><img src="/files/WbcQf07IakCpG2A7qwcV" alt=""><figcaption><p>Date settings</p></figcaption></figure>

### Dates across cards

By default, the big numbers and the last mark of the time series chart **show values for the most recent date across all periods**. In case that there is no data for this period for all cards, you can select the option to show the latest available date per card.&#x20;

### Number of periods in chart

Define the number of periods shown in the charts. The charts will adjust nicely depending on the selected number of periods.

### Date format for axis labels

Depending on the selected datepart or datetrunc for the time series chart, axis labels need to be adjusted. While the extension smartly changes the format when dragging on the date field, you can specify the label here. There, use the following logic to get your desired label formats:

* **%b**: Abbreviated month (e.g., Jan, Feb)
* **%m**: Month as a number (01–12)
* **%y**: Year (last two digits, e.g., 23 for 2023)
* **%Y**: Full year (e.g., 2023)
* **%d**: Day of the month (01–31)
* **%U**: Week number (starting from Sunday)
* **%q**: Quarter (1–4)

Example Formats:

* **%b-%y** → *Jan-23* (Month-Year)
* **%Y-%m-%d** → *2023-09-30* (Year-Month-Day)
* **%y-w%U** → *23-w40* (Year-Week Number)
* **%Y-Q%q** → *2023-Q3* (Year-Quarter)

### Show label on X-Axis

Selecting 'Hide' will hide the labels on the x-axis.

### Period flag

By default, the Big Number on the KPI cards shows the last value from the time series chart. You can get more control over this by using period flag. This flag has to be an **boolean attribute (true/false)** like

**ATTR**(DATETRUNC('month',\[Order Date])=\[Month Parameter]).

Drag this field to Detail, and map map it in the Period Flag dropdown.

<figure><img src="/files/bhKUpv5E9b4yQhWo7gdc" alt=""><figcaption></figcaption></figure>

This feature is for example useful, when you want to roll up the current year against the last year, and use the datepart of month as the datefield. A visual indicator will also be added in the trend chart to highlight the period that is being shown on the big number.

<figure><img src="/files/0UdUTIWenv6Vg8vYjCc7" alt=""><figcaption></figcaption></figure>

Period Flags can be metric-specific, except for the decomposition tree.

## Historical "As Of Date" Analysis

A common requirement is allowing users to select a historical date and have the KPI values and comparisons update relative to that selected date.

> **Important**
>
> The **Period Flag** is **not** intended for this use case. Period Flags only determine which period within the existing time series is used for the KPI call-out values (Big Number). They do **not** change the displayed date range or use a parameter as the anchor for the trend.

### Recommended Approach

To analyse KPIs relative to a selected date:

1. Create a **Date Parameter** (e.g. **As Of Date**).
2. Create a calculated field that returns a rolling time window relative to the selected date.
3. Add this calculation to the **Filters** shelf and keep only **True**.
4. Use your original **Order Date** field as the Date field in PowerKPIs.

Example calculation (Last 12 Months):

```
DATETRUNC('month', [Order Date]) <DATEADD('month', 1, DATETRUNC('month', [As Of Date Parameter]))ANDDATETRUNC('month', [Order Date]) >=DATEADD('month', -11, DATETRUNC('month', [As Of Date Parameter]))
```

By filtering the data to a rolling window, the selected date becomes the latest available period for PowerKPIs. As a result, both the KPI values and comparison calculations update relative to the selected date while keeping the trend chart complete.

***

### Video Example

Watch the video below for a complete walkthrough of configuring a parameter-driven historical date filter in PowerKPIs.

{% file src="/files/95yLByCcyqiu1ZAqyzkb" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infotopics.com/powerkpis/features/style-kpi-cards/global-settings/dates.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
