Forum Discussion

Andy19's avatar
Andy19
New Member
8 years ago

Correct Fiscal Period (YTD)

 

I am new to this DAX language and I am sure the solution is a very simple one, but I would appreciate some help.

 

I have created two measures.

MAX MONTH=MONTH(MAX('MONTHLYSALES 002'[Date]))

 

2016 ADJ NET SALES-YTD= CALCULATE(SUM([ADJUSTED NET SALES]), 'MONTHLYSALES 002'[CAL_YEAR]=2016,'MONTHLYSALES 002'[PERIOD]<=11)

 

Which gives me the desired results in Pivot Table #1

But when I substitute the “11” in the measure with a filter and the "Max Month" measure.

2016 ADJ NET SALES-YTD =CALCULATE(SUM([ADJUSTED NET SALES]), 'MONTHLYSALES 002'[CAL_YEAR]=2016, FILTER ('MONTHLYSALES 002', [PERIOD] <= [MAX MONTH]))

 

I get the below results.


 

 

 

 

 

 

 

 

 

I want to be able to use the Max Month measure which gives me the correct timeperiod, but get the results in the first table.

 

What am I doing wrong?

1 Reply