The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I need help comparing the current month to the previous month on a daily basis when the current month has fewer days than the previous month. An example of this is when I select the month of November (30 days) in my filters, my metric to calculate the value of the previous month pulls the month of October but until the 30th and not the 31st. This gets me in trouble as you don't compare the month's closings. How could you make this daily comparison in these cases?
hi @Anonymous ,
Ensure to use EDATE or DATEADD(dates[date], -1, MONTH). They always shift by month instead of day.
For further question, please consider post some sample data with expected result.
This would be an example of what im trying to do. I'm not sure if it can be done but, in this type of cases where the selected month has less days than the previous one, im trying to make the selected month to use the last day for the extra days. like in this sample a shared where the day number 30 of november is used twice for the difference table to subtract day 30 and day 31 of October which is the previous month.
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
6 |
User | Count |
---|---|
23 | |
14 | |
13 | |
10 | |
8 |