Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hi Experts, i would need DAX formula to determine the month for the date with custom start date and end date.
Start date is every 21st of the previous month and end date is every 20th of the current month.
For example, 21 Feb 2023 to 20 Mar 2023 is Mar 2023.
Also i need MTD showing based on the custom start and end date too. Possible to exclude weekend and Public holiday? i have a calendar for these.
Please help 🙂
Hi,
I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope you can add more columns into the calendar table, like weekdays or some others.
Quantity MTD: =
CALCULATE (
[Quantity:],
WINDOW (
1,
ABS,
0,
REL,
ALL ( 'Calendar'[Custom Year-Month], 'Calendar'[Date] ),
ORDERBY ( [Date], ASC ),
KEEP,
PARTITIONBY ( 'Calendar'[Custom Year-Month] ),
MATCHBY('Calendar'[Date])
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thanks Jihwan. The calendar table is very useful for me. But i dont understand the second part MTD. What does quantity stand for?
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
User | Count |
---|---|
22 | |
20 | |
20 | |
13 | |
13 |
User | Count |
---|---|
41 | |
28 | |
25 | |
23 | |
21 |