# Financial templates vsLastYear make sameperiod

Dummy-Data-File.pbix (156.8 KB)

Here’s a sample project to explain why I don’t believe I can use inbuilt time intelligence. Great if you can prove me wrong - hope you can

There is also another question within this file relating to banding - It’s all setup and working except for one column. Can you take a look at that as well please. More detail is in the file.

Thanks for your help so far

I’ve had a look through the file,

Now that I understand the scenario in more detail, yes the time intelligence formulas would not work here.

One thing…definitely start formatting your formulas better. The sooner you do this the quicker you will understand what DAX is doing within a formula.

Also placing information into a table is the best way to understand what is happening at every single results (I do this always). This way I can see the exact context on the calculation

It seems like this formula is doing what you need then so you are all good.

``````Total Orders LY using MthIndex =
SUMX(
FILTER( ALL('Calendar'),
'Calendar'[MthIndex] >=MIN('Calendar'[MthIndex])-12 &&
'Calendar'[MthIndex] <=MAX('Calendar'[MthIndex])-12),
[Total Orders])
``````

I look into other ways to do something similar but this currently looks optimal.

You could use something like the below but not neccessary

``````Order LY =
VAR CurrentYr = SELECTEDVALUE( 'Calendar'[YearIndex] )
VAR CurrentMth = SELECTEDVALUE( 'Calendar'[Fiscal Period] )

RETURN
SUMX(
FILTER( ALL( 'Calendar' ),
'Calendar'[Fiscal Period] = CurrentMth &&
'Calendar'[YearIndex] = CurrentYr - 1 ),
[Total Orders] )
``````