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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
MAC
Frequent Visitor

time intelligence changing current filter text for months

How would I set up MTD and YTD calculations such that I can specify which month to use for MTD and YTD?  I am trying to set up reports, but would like to run any month at will (ie. June month and YTD).   My date table has the entire year of 2016.

 

Thanks in advance!

1 ACCEPTED SOLUTION

I'd be glad to.

Long story short (or short story long),  I'm developing my model while still incorporating and loading my data.  I had not loaded all of my November and December data for 2016, so no MTD data was displayed. USER ERROR!!!

 

To solve:

1)  I created a dates table with a row for every day in the time period needed.

2) Created MTD metric: Prod_Days_MTD = TOTALMTD(SUM(Vessel_Days[Prod_Days]),'Dates'[DateKey])

3) Created YTD metric:  Prod_Days_YTD = CALCULATE (SUM([Prod_Days]),FILTER ( ALL ('Dates'), 'Dates'[FullYear] = MAX ( 'Dates'[FullYear]) && 'Dates'[DateKey] <= MAX ( 'Dates'[DateKey])))

 

Having a blast!!!  Now working to create meaningful visuals....  🙂

 

MAC

View solution in original post

3 REPLIES 3
MAC
Frequent Visitor

I got it!!

Hi @MAC,

 

Glad to hear that your issue got solved. Could you share us the solution for it, it will help others who have similar issue to find the solution easily.

 

Regards,

Charlie Liao

I'd be glad to.

Long story short (or short story long),  I'm developing my model while still incorporating and loading my data.  I had not loaded all of my November and December data for 2016, so no MTD data was displayed. USER ERROR!!!

 

To solve:

1)  I created a dates table with a row for every day in the time period needed.

2) Created MTD metric: Prod_Days_MTD = TOTALMTD(SUM(Vessel_Days[Prod_Days]),'Dates'[DateKey])

3) Created YTD metric:  Prod_Days_YTD = CALCULATE (SUM([Prod_Days]),FILTER ( ALL ('Dates'), 'Dates'[FullYear] = MAX ( 'Dates'[FullYear]) && 'Dates'[DateKey] <= MAX ( 'Dates'[DateKey])))

 

Having a blast!!!  Now working to create meaningful visuals....  🙂

 

MAC

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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