Forum Discussion

venug's avatar
venug
Icon for Helper II rankHelper II
6 years ago

DAX - Max Month Store wise Calculations

Hi Everyone,

 

i have table like below, when i going to calculate store wise sum. when select month in slicer that month take store type and define corrsponding values. 

 

like when i select month as 3.

output come like this....

 

R stores are { "C", "L", "N", "T" } , and the sum is : 142

N Stores are { "A", "B" } and the sum is : 78

L Stores area { "D", "E" } and the sum is : 74

 

 

StoreMonthStore typeSale
AJanR11
BJanL11
CJanL10
DJanL14
EJanR16
FJanL18
GJanL15
HJanL16
AFebL18
BFebL10
CFebN12
DFebN10
LFebL18
MFebN20
NFebR20
TFebN16
AMarN18
BMarN10
CMarR12
DMarL10
LMarR18
MMarL20
NMarR20
TMarR16

8 Replies

    • venug's avatar
      venug
      Icon for Helper II rankHelper II

      amitchandak  Thanks for respond,

       

      when i select month in slicer, the store type is different from other months, so that reason i unble to use concatenate.

       

      i am usinig below formula ...

       

      VAR monthselection = SELECTEDVALUE(Sheet1[Month N])
      VAR StoreValue = SUMX(FILTER(ALL(Sheet1), Sheet1[Month N]= monthselection && Sheet1[Store type] = "Retain" && Sheet1[Store] = "T" || Sheet1[Store] = "T" ), Sheet1[Sale])
      Return
      StoreValue

       

      here i am unble to pass stores dynamically.

       

      Please hep on this , thanks in advance..

       

      Regards

      Venu

  • Anonymous's avatar
    Anonymous
    Not applicable

    venug 

    Is this match your expected result? If not, could you clarify because I can't figure out where are the sum 142, 78, 74 come from. 

    sum = CALCULATE(SUM(Sheet3[Sale]),ALLEXCEPT(Sheet3,Sheet3[Store type],Sheet3[Month]))

     

    Paul Zheng
    Don't forget to hit THUMBS UP and mark it as a solution if it helps you!