Forum Discussion
Apply Month Calculation to Row Without Changing Month Calculation
I have this measure:
MonthChange = sumx(VALUES('Calendar'[Month Year]),[Gross Adds]- CALCULATE([Gross Adds],SAMEPERIODLASTYEAR('Calendar'[Calendar Date])))/sumx(VALUES('Calendar'[Month Year]),[Gross Adds])
The result gives me an overall % change for the month compared to last year as -.11%. I wanting to multiply the -.11% to PYSalesByWeek measure. However [Month Change] will compute by row instead of overall month.
% Applied = [PYSalesByWeek]+([MonthChange]*[PYSalesByWeek])
I'm wanting to remain at -.11. instead of -.08 and -.1.32, respectively. How to accomplish?
| PYSalesByWeek | Week Ending Date | Gross Adds | MonthChange | % Applied |
| 2948 | 10/27/2024 0:00 | 2722 | -0.08 | 2716.23 |
| 2911 | 11/3/2024 0:00 | 749 | -1.32 | -921.10
|
7 Replies
- Irwan
Super User
hello BrianNeedsHelp
i think you need to add ALL('table') in your measure so the result will calculate all data.
Thank you.
- sanalytics
Super User
Hello BrianNeedsHelp
Can you modify the % Applied measure with below code.% Applied = VAR OverallMonthChange = CALCULATE([MonthChange], REMOVEFILTERS('Calendar'[Calendar Date])) RETURN [PYSalesByWeek] + (OverallMonthChange * [PYSalesByWeek])
Regardssanalytics
If it is your solution then please like and accept it as solution
- BrianNeedsHelp
Resolver I
Hi Irwan It looks like it would work, but it will always apply the logic to the row instead of the overall month. For now I just put in a parameter and adjust the % manually based on what is in the overall month change Card. Thx for replying-if you figure out another way please let me know.
- AnonymousNot applicable
Hi BrianNeedsHelp , hello sanalytics and Irwan , thank you for your prompt reply!
Please try this:% Applied = VAR OverallMonthChange = CALCULATE( SUMX(VALUES('Calendar'[Month Year]), [Gross Adds] - CALCULATE([Gross Adds], SAMEPERIODLASTYEAR('Calendar'[Calendar Date]))) / SUMX(VALUES('Calendar'[Month Year]), [Gross Adds]), ALL('Calendar'[Calendar Date]) ) RETURN [PYSalesByWeek] + (OverallMonthChange * [PYSalesByWeek])Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.