Forum Discussion

Krjen156's avatar
Krjen156
New Member
1 year ago
Solved

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

  • Hi Krjen156 

    What measures did  you use? How does your model look? Also, please post a workable sample data (not an image) and your expected result from that with the reasoning.

      • danextian's avatar
        danextian
        Icon for Super User rankSuper 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 )
            )