Forum Discussion
Time Intelligence. Quarter and Last Quarter
Hello!
I'm trying to create a report of financial statements. The most recent data is from Q3 (2024-09-31).
My datetable contains data from 2020-01-01 to 2024-12-31. I've created a calculation group containing "Quarter", "Last Quarter" and "Quarter Over Quarter". The problem occurs when I filter on "Last Quarter"- then the same value as "quarter" shows because todays date is in Q4, and it shows last quarter which is Q3 (but I want Q2 to show because there is no data for Q4 yet.
Any suggestions on how I can solve this?
I honestly don't get the reasoning behind why you want to show the data from 2 quarters ago for LQ if the latest quarter is blank but here you go
LQ = VAR Q = CALCULATE ( SELECTEDMEASURE (), DATESQTD ( 'Date'[Date] ) ) VAR _Count = IF ( ISBLANK ( Q ), -2, -1 ) RETURN CALCULATE ( SELECTEDMEASURE (), DATEADD ( DATESQTD ( 'Date'[Date] ), _Count, QUARTER ) )
4 Replies
- Krjen156New Member
Done!
- danextian
Super User
I honestly don't get the reasoning behind why you want to show the data from 2 quarters ago for LQ if the latest quarter is blank but here you go
LQ = VAR Q = CALCULATE ( SELECTEDMEASURE (), DATESQTD ( 'Date'[Date] ) ) VAR _Count = IF ( ISBLANK ( Q ), -2, -1 ) RETURN CALCULATE ( SELECTEDMEASURE (), DATEADD ( DATESQTD ( 'Date'[Date] ), _Count, QUARTER ) )
- Bibiano_Geraldo
Super User