March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi
I am trying to calculate the fiscal YTD amount for all previous years for multiple companies. I need the fiscal period to be dynamic as each company has a different fiscal period. At the moment I can get it to work using the following code but the fiscal year end is not dynamic (is is 03-31 for all companies for which the calculation is applied)
Turnover FY:= CALCULATE ( [Turnover Amount], DATESYTD ( 'AccountingPeriod'[Date], "03-31" ) )
Anyone solve this before or could guide me to a solution?
Here is an example data set, in it I have company A and B with fiscal periods ending 01/10 and 01/06. Column 'Turnover FY' is the calculation I am trying to create
Thanks in advance 🙂
Solved! Go to Solution.
Hi @Monty0
you can download the file: https://1drv.ms/u/s!AiiWkkwHZChHj0ItKq-ShSK2gIqr
build this model:
Then add this measure:
Measure = IF ( HASONEVALUE ( 'Calendar'[Month] ), SUMX ( Companies, VAR FYEDate = DATE ( YEAR ( MAX ( 'Calendar'[Date] ) ), Companies[FYE Month], Companies[FYE Day] ) VAR PeriodBegin = IF ( MAX ( 'Calendar'[Date] ) > FYEDate, FYEDate + 1, EDATE ( FYEDate, -12 ) + 1 ) RETURN CALCULATE ( SUM ( Turnover[Turnover Amount] ), DATESBETWEEN ( 'Calendar'[Date], PeriodBegin, MAX ( 'Calendar'[Date] ) ) ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @Monty0
are you able to post a sample dataset?
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Hi @Monty0
you can download the file: https://1drv.ms/u/s!AiiWkkwHZChHj0ItKq-ShSK2gIqr
build this model:
Then add this measure:
Measure = IF ( HASONEVALUE ( 'Calendar'[Month] ), SUMX ( Companies, VAR FYEDate = DATE ( YEAR ( MAX ( 'Calendar'[Date] ) ), Companies[FYE Month], Companies[FYE Day] ) VAR PeriodBegin = IF ( MAX ( 'Calendar'[Date] ) > FYEDate, FYEDate + 1, EDATE ( FYEDate, -12 ) + 1 ) RETURN CALCULATE ( SUM ( Turnover[Turnover Amount] ), DATESBETWEEN ( 'Calendar'[Date], PeriodBegin, MAX ( 'Calendar'[Date] ) ) ) ) )
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Thank you LivioLanzo, outstanding!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |