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
Pbi07
Helper V
Helper V

SAMEPERIODLASTYEAR with fiscal year

 

Hello -  I am trying to get the current YTD and the last year data for the below data. 

The table has the fiscal year & Period and the journal date which is a bit irrelevant. The period runs from May to April. Journal dates are not helping as the journals could be posted even on 05/10/2020 for fiscal year 2020 period 12. I looked at various timeseries functions posted and tried with a date table , but the SAMEPERIOD function did not provide the results as i do not have a relationship set on the journal date.  Is there anyway that i could utilize the DAX function to get the totals for the year and previousyear for month ending 04/30? 

 

I had looked at the blog of @amitchandak . But the relationship was against the dates whereas in this case, i will not be able to use it. 

https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...

 

My sample model data is here 

https://drive.google.com/file/d/1ismD2IB5GyFgB2YUfuUDtb2rYOgtB47T/view?usp=sharing 

 

 

3 REPLIES 3
lbendlin
Super User
Super User

You can use DATEADD, DATESBETWEEN or EDATE instead of SAMEPERIODLASTYEAR if you need better control over fiscal years.

@lbendlin 

I cannot have a relation set for the date in the fact table. How can i use the dateadd for such a scenario?

Use DATESBETWEEN  instead - that might work even with gapped data.

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.

Top Solution Authors