- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Show last label only on a line chart
Hello Power BI Community,
I have a question regarding creating a line chart using inflation data. The axis for the chart should contain both the quarter and year information. However, my data structure for quarters is unique, where Q1 represents only March, Q2 represents only June, Q3 represents only September, and Q4 represents only December. It is not the traditional quarterly structure like Q1: Jan - March, Q2: April - June, etc.
From this data, I want to create a line chart and display only the last value on the label. To achieve this, I have written a DAX formula named "Latest_Inflasi_Jatim_3" to show the last value only as written below:
Latest_Inflasi_Jatim_3 =
VAR Latest_Date = LASTDATE(PERIODE[Date])
VAR Latest_Quarter = QUARTER(Latest_Date)
VAR Latest_Year = YEAR(Latest_Date)
VAR Latest_Quarter_Start_Date = SWITCH(
Latest_Quarter,
1, DATE(Latest_Year, 3, 1),
2, DATE(Latest_Year, 6, 1),
3, DATE(Latest_Year, 9, 1),
4, DATE(Latest_Year, 12, 1) )
VAR Latest_Inf =
CALCULATE( data_inflasi_provinsi[inflasi_yoy_jatim],
FILTER( data_inflasi_provinsi, data_inflasi_provinsi[tanggal] >= Latest_Quarter_Start_Date && data_inflasi_provinsi[tanggal] <= Latest_Date ) )
RETURN Latest_Inf
The issue is that this formula currently displays all the values for each quarter, whereas I only want to show the latest quarter and year. For example, if my data ends in April 2023, I want to display only the data for Q1 2023 which means the data shows is the data in March 2023.
(the issue)
Any guidance on how to modify the DAX formula to achieve this would be greatly appreciated. Thank you in advance for your help!

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-24-2024 09:13 AM | |||
09-17-2024 08:14 PM | |||
08-22-2024 12:04 PM | |||
11-19-2024 05:40 AM | |||
10-15-2024 01:39 AM |