Forum Discussion
Custom Time Intelligence - Current Day in Month vs. Prior Months
I currently have weekly sales data refresh. I am looking to compare Week 1 of the month vs. prior Week 1's of all the prior months before that visually. In Week 2 I am looking to see a Cumulative sales for week1+2 vs. all prior Week 2 cumulative's of all the prior months. This would be the same for week 3 and week 4 as the data refreshes.
Is there custom coding that can allow me to do this? looking at MTD sales vs. Prior MTD using time intelligence does not provide the same outcome I am looking for.
thanks,
Yeah, sort of. Keep in mind that this will be very wobbly at the beginning of the month. Let's say
July - starts on a Friday
August - starts on a Monday
September - starts on a Thursday
Let's assume you only have transactions Monday through Friday.
First 6 days:
July: 4 working days
Aug: 5 working days
Sept: 4 working days
I think you can see where this is going. It becomes less of a problem the older a month gets.
5 Replies
- lbendlin
Super User
I am looking to compare Week 1 of the month vs. prior Week 1's of all the prior monthsWeeks and months are incompatible.
- Dlahey
Helper I
How about days in month vs. same days in month vs. prior months?
ie. Sep = 6 days, vs. Aug = first 6 days, vs. Jul = first 6 days.....
- lbendlin
Super User
Yeah, sort of. Keep in mind that this will be very wobbly at the beginning of the month. Let's say
July - starts on a Friday
August - starts on a Monday
September - starts on a Thursday
Let's assume you only have transactions Monday through Friday.
First 6 days:
July: 4 working days
Aug: 5 working days
Sept: 4 working days
I think you can see where this is going. It becomes less of a problem the older a month gets.
- AnonymousNot applicable
Hi Dlahey ,
Based on your description, please try this measure.
Measure = VAR _date = CALCULATE(MAX('FactSalesTable'[Date]),ALL('FactSalesTable')) VAR _day = DAY(_date) VAR _year = SELECTEDVALUE('Calendar'[Year]) VAR _month = SELECTEDVALUE('Calendar'[Month Number]) VAR _sales = CALCULATE(SUM('FactSalesTable'[Sales]),FILTER('Calendar','Calendar'[Date]>=DATE(_year,_month,1)&&'Calendar'[Date]<=DATE(_year,_month,_day))) RETURN _salesThe PBIX file is attached for reference.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data