Forum Discussion
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
| Store | Month | Store type | Sale |
| A | Jan | R | 11 |
| B | Jan | L | 11 |
| C | Jan | L | 10 |
| D | Jan | L | 14 |
| E | Jan | R | 16 |
| F | Jan | L | 18 |
| G | Jan | L | 15 |
| H | Jan | L | 16 |
| A | Feb | L | 18 |
| B | Feb | L | 10 |
| C | Feb | N | 12 |
| D | Feb | N | 10 |
| L | Feb | L | 18 |
| M | Feb | N | 20 |
| N | Feb | R | 20 |
| T | Feb | N | 16 |
| A | Mar | N | 18 |
| B | Mar | N | 10 |
| C | Mar | R | 12 |
| D | Mar | L | 10 |
| L | Mar | R | 18 |
| M | Mar | L | 20 |
| N | Mar | R | 20 |
| T | Mar | R | 16 |
8 Replies
- amitchandak
Super User
With help concatenatex, you should able to group text. The number you can get using sum.
https://docs.microsoft.com/en-us/dax/concatenatex-function-dax
- venug
Helper 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
StoreValuehere i am unble to pass stores dynamically.
Please hep on this , thanks in advance..
Regards
Venu
- amitchandak
Super User
Same issue as pointed above numbers not matching.
https://www.dropbox.com/s/pq5ighswql7pu9w/concatExample.pbix?dl=0
- AnonymousNot 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!