Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a date filter on my dashboard, that is currently set at 1/1/2019(start) and 1/27/2020(end). I have a matrix with Mth-Yr in columns and data in each column. I am trying to calculate the % change in Jan 2020 to Dec 2020, but the problem is, there are only 27 days in the current month of Jan 2020. So what is the best way, or is there a way, to calculate MoM% change, given the date filter, to compare Jan 1-27 2020 to Dec 1-27 2019, instead of Dec 1-31 2019?
Thank you in advance
Solved! Go to Solution.
Thanks all for the quick responses, but I found a solution that works. I am using the following measure to accomplish this.
Thanks all for the quick responses, but I found a solution that works. I am using the following measure to accomplish this.
Hi @cwnoll,
does it really matter?
I mean do you also consider working days?
Or how do you compare February 2019 (28 Days) to March 2019 (31 Days)?
Perhaps you could consider the percentage progress of the month. (27/31 = 87%)
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
Create a date calendar and following calculations should help, check for complete last month
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
MTD (Year End) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date])))
MTD (Last Year End) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH))))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.
Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |