Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Thimma
Frequent Visitor

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,

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.