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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
menphis21
Helper IV
Helper IV

Using fiscal year to display calendar date with previous period last year

Hi Everyone,

 

I have a graph that display the collection amount by year/Month with the amount of previous period and and the % variation as a line.

Now i need to change the filter calendar date to the fiscal date.

i have a table where i have my calendar date and the conversion.

 

I am using for the Collection amount previous period this formula :

Collection Amount N-1 = CALCULATE([Collection Amount],SAMEPERIODLASTYEAR('Date table'[Date].[Date]))
 
For the % variation i am using : 
Collection Mom amount = ([Collection Amount]-[Collection Amount N-1])/[Collection Amount N-1]
 
In the filter, i have the fiscal date. In the graph, i am displaying the calendar date (hierarchy date) and previous period and current period.
But its not showing me what i supposed to see.
 
Thanks for the help
Fiscal date collection.PNG
 
 

 

 

6 REPLIES 6
menphis21
Helper IV
Helper IV

AllisonKennedy
Super User
Super User

@menphis21  That's looking correct. What happens when you select 2023 in the filter for fiscal year? It just looks like you don't have data for 2021 in the report, and you need to choose the current fiscal year, not the previous one for the filter context.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy ,

Thank you. Yes i have data for 2021.

When i remove the selection on the filter, i see that : 

Fiscal date collection without filter .PNG

 

In the model, the collection table and date table are related with the calendar date.
The fiscal date is build on base of Fiscal Month and fiscal Year so the date is repeated inside the month.

 

date table.PNG

@menphis21  Yes, so if you select Fiscal Year 2023 you should see data for both Current Period and Collection Amount N-1. 

 

It's just a matter of keeping straight what 2023 fiscal year means for calendar dates in your visual.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy ,

 

Its not solving the problem.

What i did finally :

 

The calendar that i created from collection table is based on field Year and month.

On the beginning, i created date like #date([Year],[Month],1).

But with that date linked to dimcalendar, the function dateadd and sameperiodlast year didnt work as seen before.

 

What i did, i created a new date #date([Year],[Month],15) and now the table collection is linked on this date and now the function dateadd works only.

 

the calendar date can be related to 2 fiscal month in the same time.

but i dont understand why its a problem

 

Date screen2.PNG

@menphis21  It shouldn't matter whether you use 1st or 15th of the month (except for when you want the actuals to display). 

 

Your screenshot without the Fiscal Date filter looks to be working perfectly: 

 

AllisonKennedy_0-1678142310413.png

 

 

You can see the circled bit has data for both Current period and 'Collection Amount N-1'. The Underlined bit only has data for 'Collection Amount N-1' because we don't have current (actual) data for this period yet, so we can only see what was happening last year. That 9.0M is an easy one to look at - you can see that matches the 'Current Period' for June 2022 and the 'Collection Amount N-1' for June 2023.

 

You can only have 1 active relationship between dates at a time with 1 date table. To get around this you need to use USERELATIONSHIP with inactive relationship or add another date table. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.