Forum Discussion
Dynamic total sales with moving week
- Anonymous6 years ago
HI Anonymous,
So you mean you want to display selected report week and the first week of each row? If this is a case, you can refer to following measure formula:
Measure = VAR currRW = MAX ( Table[REPORT WEEK] ) VAR currSW = MAX ( Table[SALES WEEK] ) VAR week = CALCULATETABLE ( VALUES ( Table[SALES WEEK] ), FILTER ( ALLSELECTED ( Table ), [REPORT WEEK] <= MAX ( Selector[REPORT WEEK] ) ), VALUES ( Table[REPORT WEEK] ) ) RETURN IF ( currRW IN ALLSELECTED ( 'Selector'[REPORT WEEK] ) || currSW = MINX ( week, [SALES WEEK] ) && ISFILTERED ( Table[SALES WEEK] ), CALCULATE ( SUM ( Table[SALES TOTAL] ), ALLSELECTED ( Table ), VALUES ( Table[REPORT WEEK] ), VALUES ( Table[SALES WEEK] ) ) )Regards,
Xiaoxin Sheng
Thanks Anonymous ,
Works really good! I would need one last thing, please: as of now, it displays what I want but when it comes to TOTALS it's not accurate.
170,455 is correct for those 4 weeks. What I am after now is to have the that SUM + the sales quantities displayed in the previous weeks. In this case that SUM will be a total of 498,931
In a graphic way would be like:
Is this possible?
Thanks once again a lot for your support!
Best regards,
Alan.
Hi Anonymous,
In fact, the graph is force achiec based on a few filter and conditions. For this scenario, it is hard to accurately control the result displays on the total level. (I already use these filter that used to check total level)
Regards,
Xiaoxin Sheng
- Anonymous6 years agoNot applicable
Thank you!
I thought it would be rather complicated to have such thing nevertheless the solution already works very well 🙂Thanks again for your time!
Best regards,
Alan