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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Andy19
New Member

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

Table 1.png

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.


Table 2.png

 

 

 

 

 

 

 

 

 

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 1
v-chuncz-msft
Community Support
Community Support

@Andy19,

 

Simplify the model and share us a complete example so that we could have a test.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.