Forum Discussion
Anonymous
4 years agoNot applicable
Dax formula - Select value - all except
Good morning, I am trying to create a new column ( example below" created " column is the result I would like to get ). The new column should copy the value of the " DEN" column for each KPI ( takin...
Anonymous
4 years agoNot applicable
| kpi | TIME | CLUSTER | SUB CLuster | Market | category | B. Area | num | num-calc | den | den-calc | created |
| NNS | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 5819,913 | 5819,913 | 0 | 0 | 0 |
| OthRev | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 0 | 0 | 5819,913 | 0 | 5819,913 |
| COGS | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 2223,9234 | 2223,9234 | 5819,913 | 0 | 5819,913 |
| Comm & OVE | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 12,8834 | 12,8834 | 5819,913 | 0 | 5819,913 |
| VDC 3P | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 216,1187 | 216,1187 | 5819,913 | 0 | 5819,913 |
| TDC | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 5332,1178 | 5332,1178 | 5819,913 | 0 | 5819,913 |
| Structural Costs | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 1332,2886 | 1332,2886 | 5819,913 | 0 | 5819,913 |
| NNS Aff | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 2189,4962 | 2189,4962 | 0 | 0 | 5819,913 |
| OP1 Aff | 2021 YTD - 02 | AOA Cluster | Oceania | Oceania | MN | Medical Nutrition | 183,6664 | 183,6664 | 2189,4962 | 0 | 2189,4962 |
| Volumes | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 616 | 616 | 150 | 0 | 150 |
| GPS | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 8839,1286 | 8839,1286 | 150 | 0 | 150 |
| OthRev | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 0 | 0 | 150 | 0 | 150 |
| COGS | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 2223,9234 | 2223,9234 | 150 | 0 | 150 |
| Comm & OVE | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 12,8834 | 12,8834 | 150 | 0 | 150 |
| VDC 3P | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 216,1187 | 216,1187 | 150 | 0 | 150 |
| TDC | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 5332,1178 | 5332,1178 | 150 | 0 | 150 |
| Structural Costs | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 1332,2886 | 1332,2886 | 150 | 0 | 150 |
| NNS Aff | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 2189,4962 | 2189,4962 | 0 | 0 | 150 |
| NNS | 2021 YTD - 02 | AOA Cluster | Oceania | Pakistan | MN | Medical Nutrition | 150 | 150 | 0 | 0 | 0 |
v-chenwuz-msft
4 years agoCommunity Support
Hi Anonymous ,
Column =
VAR _o = [den]
VAR _nns_aff_index =
MAXX (
TOPN (
1,
FILTER ( 'Table', [kpi] = "NNS" ),
ABS ( [Index] - EARLIER ( 'Table'[Index] ) ), ASC
),
[Index]
)
VAR _value =
CALCULATE (
MAX ( 'Table'[num-calc] ),
FILTER ( 'Table', [Index] = _nns_aff_index )
)
RETURN
IF ( [kpi] = "nns aff", _value, _o )
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Hello,
how could I change the formula such that it returns as the " den " the sum of the NNS with the same market. screen bellow
the value that should appear in Den for the NNS Aff should be the sum of NNS with the same market :
den should be = 2112
Your formula works however i would like that the formula take into consideration if there is multiple NNS .
GMHL5 Cluster Num - Calc Den Nombre Category KPI Month Year Sub-Cluster Period Type Market Business Area Buy-Make-Supply NUM aff B Type old formula Index RESULT International LATAM 438,1797 0 1 MN NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Medical Nutrition 438,1797 YTD 0 409213 0 International LATAM 310,1787 0 1 VMHS NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Sundown 310,1787 YTD 0 409558 0 International LATAM 57,3057 0 1 VMHS NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Osteo Biflex 57,3057 YTD 0 409490 0 International LATAM 4,5481 0 1 VMHS NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Solgar 4,5481 YTD 0 409422 0 International LATAM 737,6978 0 1 VMHS NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Nature's Bounty 737,6978 YTD 0 409354 0 International LATAM 563,6089 0 1 CC NNS 07 2022 Andina/Platina 2022 YTD - 07 Argentina Consumer Care 563,6089 YTD 0 409285 0 International LATAM 15,948 0 1 MN NNS Aff 07 2022 Andina/Platina 2022 YTD - 07 Argentina Medical Nutrition AFF Balance -15,948 YTD 438,1797 409245 2111,519