Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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!