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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I am trying to get the current/highest date and last date of the previous quarter available.
Here is my data. Please help me in wriring dax for this.
Thanks,
Pooji
Hi @Fowmy
I am able to get the data as below:
here is the dax i have used for getting that:
Latest Quarter = if( 'Historical Performance by Fund'[Date]=max('Historical Performance by Fund'[Date]),1,0)
Finallastdayprevdate = if( 'Historical Performance by Fund'[Date]=max('Historical Performance by Fund'[Previous year]),1,0)
Well! This is wroking but my requirement is different.
I have a page level filter applied based on fund column.
Am unable to attach the pbix file here. So attaching the screenshot.
My X- Axis should be able to show the current date and last date of previous quarter. Y - Axis has 3 columns as shown above.
Thanks,
Pooji
@Pooji
Save your file in Google or One Drive and share the link here
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Pooji
The question is not clear enough, better if you could provide data and the expected results. Anyhow, you can use the following measure to get the last date of the previous quarter.
Last Date Prev Qtr = MAXX( PREVIOUSQUARTER('Dates'[Date]) , Dates[Date] )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Fowmy
I am trying to replicate the below bar chart.
The left side 2 bars should be shown with last quarter of previous year.
And the right side 2 bars should be shown based on current or highest date available.
Here is the data:
Eg: As per the data, it should show the last 2 rows - Q4 2020 and Q1 2021. And the data related to these 2 rows.
Thanks,
Pooji.
@Pooji
Create the following two measures, it will give you the Lates Quarter total and last quarter in the previous year.
Latest Cost =
VAR __MaxDate = CALCULATE( MAX(Table3[Date]) , REMOVEFILTERS( Table3)) RETURN
CALCULATE(
SUM(Table3[Cost]),
Table3[Date] = __MaxDate
)Prev Year Last Qtr Cost =
VAR __MaxDate = CALCULATE( MAX(Table3[Date]) , REMOVEFILTERS( Table3))
VAR __LyLastQtr =
CALCULATE(
MAX(Table3[Date]),
FILTER( all(Table3[Date]) , YEAR(Table3[Date]) = YEAR(__MaxDate)-1),
REMOVEFILTERS( Table3)
)
RETURN
CALCULATE(
SUM(Table3[Cost]),
Table3[Date] = __LyLastQtr ,
REMOVEFILTERS(Table3)
)
You can create a dummy table to get the same layout as per your example chart.
I attached the file below.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |