Forum Discussion
George1973
Helper V
4 years agoSummarization for Measure Does not Work
Hi Guys, I have a measure counting sales ever existence number of month having sales activity within last 3 months. 1st 3_M WoUsg =
VAR FMnCount3 =
UNION(
ROW("MTV",[-1M]),
ROW("MTV",[...
- 4 years ago
Hi George1973
you may try
1st 3_M WoUsg = VAR FMnCount3 = UNION ( ROW ( "MTV", [-1M] ), ROW ( "MTV", [-2M] ), ROW ( "MTV", [Sold Prod Qnty] ) ) RETURN SUMX ( VALUES ( Table[Code] ), CALCULATE ( COUNTAX ( FMnCount3, [MTV] ), FILTER ( FMnCount3, [MTV] > 0 ) ) ) - 4 years ago
tamerj1
I think I found an alternative solution. At least for the final purpose, it is more than enough:Month Usage Sum = VAR FMG=ADDCOLUMNS(allselected(C_GOODS[პროდუქციის კოდი]),"Pr_Code",C_GOODS[პროდუქციის კოდი],"3M_Usg",[1st 3_M WoUsg],"12M_Usg",[1st Y_M WoUsg]) VAR Sum12M=sumX(filter(FMG,[12M_Usg]=12),[3M_Usg]) VAR Sum11M=sumX(filter(FMG,[12M_Usg]=11),[3M_Usg]) VAR Sum10M=sumX(filter(FMG,[12M_Usg]=10),[3M_Usg]) VAR Sum9M=sumX(filter(FMG,[12M_Usg]=9),[3M_Usg]) VAR Sum8M=sumX(filter(FMG,[12M_Usg]=8),[3M_Usg]) VAR Sum7M=sumX(filter(FMG,[12M_Usg]=7),[3M_Usg]) VAR Sum6M=sumX(filter(FMG,[12M_Usg]=6),[3M_Usg]) VAR Sum5M=sumX(filter(FMG,[12M_Usg]=5),[3M_Usg]) VAR Sum4M=sumX(filter(FMG,[12M_Usg]=4),[3M_Usg]) VAR Sum3M=sumX(filter(FMG,[12M_Usg]=3),[3M_Usg]) VAR Sum2M=sumX(filter(FMG,[12M_Usg]=2),[3M_Usg]) VAR Sum1M=sumX(filter(FMG,[12M_Usg]=1),[3M_Usg]) VAR Sum0M=sumX(filter(FMG,[12M_Usg]=0),[3M_Usg]) Return Sum11MFirst it calculates the grand total sum for the the months with existing sales and then, I can refer to the SUMS with the second criteria from [12M_Usg].. be it 1, 2,3... or 12..
The final result has been achieved. That's all I wanted! :))) Thanks a lot again1
George1973
Helper V
4 years agotamerj1 ,
Unfotunately the results with the newest (simle) formula got worse (Differences increase)
Month Usage Sum = SUMX ( VALUES (C_GOODS[პროდუქციის კოდი]), [1st 3_M WoUsg] )
tamerj1
Community Champion
4 years agoCan you place both measures in a separate matix along with the codes in the rows
- George19734 years ago
Helper V
Like that?
- tamerj14 years ago
Community Champion
I mean copy the matrix and remove everything except the the old and the new measures
- George19734 years ago
Helper V
Code 1st 3_M WoUsg Month Usage Sum 00273 1 1 00592 1 01269 1 1 01293 1 1 01311 3 3 01312 2 2 01314 3 3 01346 1 01558 2 2 01568 1 1 01569 1 01570 3 3 01571 3 3 01578 3 3 01580 2 2 01581 3 3 01583 2 2 01593 1 1 01843 2 01987 3 3 01996 1 02714 2 2 02716 1 02847 2 2 02982 2 2 03310 1 1 03358 1 03371 1 03372 3 3 03437 2 2 03515 1 1 03516 1 03517 1 1 03586 2 2 03771 3 3 03884 1 1 03892 1 03899 3 3 03950 3 3 03954 2 2 04048 1 04128 1 04508 3 3 04509 3 3 04534 1 04583 1 1 04790 3 3 04791 1 1 04830 3 3 04834 1 1 04964 1 04968 1 1 04969 1 04970 1 1 05099 3 3