Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Time Intelligence functions

Hi,

 

I have very simple data and wanted to write dax for some time intelligence functions like as YTD, LYTD, Last 12 months rolling, sameperiodlastyear.

 

I have filters as Year and Month.

 

When I select Year 2022 and Month Mar my results should be

 

CurrentMonth= Revenueactuals measure should be 2022March

YTD: Revenueactuals measure should 2022 Jan to 2022 March

LYTD: Revenueactuals measure should be 2021 Jan to 2021 March

Last 12 months rolling measure should be 2022 March to 2021 Apr

Sameperiodlastyear measure should be 2021 March.

 

If I select 2021 and April it should be done same as above. attached data set for your reference.

 

I tried implementing DAX, but that changes values based on my current selection and all measure balue showing selected year and month only.

 

Sr NoDateRevenue Actuals
101/01/20211200
228/01/2021400
315/01/2021943
401/02/2021432
528/02/2021361
615/02/20211
701/03/2021251
828/03/2021746
915/03/2021463
1001/04/2021-598
1128/04/2021333
1215/04/2021456
1301/05/2021966
1428/05/2021202
1515/05/2021112
1601/06/2021973
1728/06/2021100
1815/06/2021742
1901/07/202181
2028/07/2021978
2115/07/2021222
2201/08/2021232
2328/08/2021879
2415/08/2021918
2501/09/2021726
2628/09/2021645
2715/09/2021654
2801/10/2021916
2928/10/2021188
3015/10/2021291
3101/11/2021261
3228/11/2021943
3315/11/2021746
3401/12/2021674
3528/12/2021746
3615/12/2021734
3701/01/2022829
3828/01/2022746
3915/01/2022839
4001/02/2022753
4128/02/2022846
4215/02/2022273
4301/03/2022763
4428/03/2022957
4515/03/2022364
4601/04/2022847
4728/04/2022347

Appreciated your support.

 

Thanks,

 

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish,

       

      When I tried to create Sameperiod last year it is not giving the correct results.

       

      Same selected Month and Year but Last Year:

      CALCULATE(SUM(Amount),SAMEPERIODLASTYEAR(Date))

       

      I am trying below requirement as well, but couldn't success.

       

      YTD: My financial year starts from APRIL to MARCH when I selected 2022 and APRIL. I suppose to see 2022 APRIL to 2023 March.  not sure how to get this done.

       

      Last Year YTD: When I select 2022 APRIL then I supposed to see 2021 APRIL to 22 MARCH.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        I am not sure of what you want.  Share some data and show the expected result.