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
hanyfouda2023
Helper II
Helper II

YTD & MTD report

Hi Helpers,

I attached sample report  because I need to make it from my source data in PBI 

hanyfouda2023_0-1705906655445.png

I need to know how to calculate YTD , MTD & Sales performance 

9 REPLIES 9
Anonymous
Not applicable

Hi @hanyfouda2023 ,

You can use the calculation group to put in the indicators for 2023 and 2024, and just calculate the MTD and YTD to know all the indicators for these two years, for your easy comparison.

The calculation group DAX might work for you:

MTD = CALCULATE(SELECTEDMEASURE(), DATESMTD('Date'[Date]))


PY = CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))


YTD = CALCULATE(SELECTEDMEASURE(), DATESYTD('Date'[Date]))

Here are some of my examples that can be just replaced with your data

vxiandatmsft_0-1705987901524.png

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi v-xiandat,

Thanks for your replay,

For MTD it works fine but for PY & YTD not accurate, when I seleced year 2023 & 2024 PY & YTD calaculated 2 periods 

For example if MTD is 10 for 2024 , 10 for 2023 for the same period last year then PY & YTD became 20 instead of 10 

here is the measures

PY = CALCULATE([Total Revenue], SAMEPERIODLASTYEAR(Datetable[Date]))
YTD_11 = CALCULATE([Total Revenue], DATESYTD(Datetable[Date]))
Thanks
Anonymous
Not applicable

Hi @hanyfouda2023 ,

Can you send me your pbix file, I'd like to see where the problem is occurring.

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello , sorry for late answer could you please let me know how to send you the file here

Hi  v-xiandat-msft,

Thanks for your support but due to internal company issues I cant share any company data in public

Thanks

Daniel29195
Super User
Super User

@hanyfouda2023 

 

can you show me with a screenshot what you mean  ? 

Daniel29195
Super User
Super User

hello @hanyfouda2023 

 

you can use this pattern : 

MTD : 

Measure  MTD=
CALCULATE(
    [Revenue],
    DATESMTD('Date Table'[Date]))
)
 
 

YTD : 

Measure YTD =
CALCULATE(
    [Revenue],
    DATESYTD('Date Table'[Date]))
)
 


these measure will work assumming you have a the appropriate dimdate table in your model .
 
 
 
 
If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit thumbs up button 👍

Hi Daniel29195,

It works fine but if I need to make it for year 2023 in the same visual to compare it with 2024 how can i make it because when I select 2023 to 2024 MTD became not accurte

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors