March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Helpers,
I attached sample report because I need to make it from my source data in PBI
I need to know how to calculate YTD , MTD & Sales performance
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
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
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.
Here you are the file for your support
https://drive.google.com/file/d/1UfWPmvxhpBH-GGE1Gj9hHA3YKRAPvNvQ/view?usp=sharing
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
hello @hanyfouda2023
you can use this pattern :
MTD :
YTD :
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
92 | |
86 | |
77 | |
49 |
User | Count |
---|---|
166 | |
149 | |
99 | |
73 | |
57 |