Forum Discussion
DAX measure does not sum value correctly
Dear All,
i have the following measures defined:
Resulting Data Excerpt
| Date | TOTAL_FACT_NCAMOUNT | NearestDate | SelectedBETIS |
| ... | ... | ... | |
| 29.03.2023 00:00:00 | 31.03.2023 00:00:00 | 5474 | |
| 30.03.2023 00:00:00 | 31.03.2023 00:00:00 | 5474 | |
| 02.04.2023 00:00:00 | 10 | 02.04.2023 00:00:00 | 5474 |
| 03.04.2023 00:00:00 | 10 | 03.04.2023 00:00:00 | 5474 |
| 04.04.2023 00:00:00 | 10 | 04.04.2023 00:00:00 | 5474 |
| 10.04.2023 00:00:00 | 10 | 10.04.2023 00:00:00 | 5474 |
| 11.04.2023 00:00:00 | 10 | 11.04.2023 00:00:00 | 5474 |
| 12.04.2023 00:00:00 | 10 | 12.04.2023 00:00:00 | 5474 |
| 13.04.2023 00:00:00 | 10 | 13.04.2023 00:00:00 | 5474 |
| 16.04.2023 00:00:00 | 10 | 16.04.2023 00:00:00 | 5474 |
| 17.04.2023 00:00:00 | 10 | 17.04.2023 00:00:00 | 5474 |
| 18.04.2023 00:00:00 | 10 | 18.04.2023 00:00:00 | 5474 |
I am lost, how to tackle the problem. Goal is to get only sum of VALUES on NearestDate and SelectedBetis in Table "Non_FIMI_Data"
Thanks for any thought, ideas.
Many thanks
BB
- Anonymous3 years ago
HI BB76,
It seems like a common measure calculate issue when it works with multiple level of aggregations.
For this scenario, I'd like to suggest you refer to the following blog to add variable with SUMMARIZE function to handle the first level calculations. Then you can use iterator functions to summary previous step calculation results.
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
2 Replies
- AnonymousNot applicable
HI BB76,
It seems like a common measure calculate issue when it works with multiple level of aggregations.
For this scenario, I'd like to suggest you refer to the following blog to add variable with SUMMARIZE function to handle the first level calculations. Then you can use iterator functions to summary previous step calculation results.
Measure Totals, The Final Word
Regards,
Xiaoxin Sheng
- BB76Helper I
peferct thanks giving me a hint. Solution is to introduce [NeareasDate] as variable:
TOTAL_FACT_NCAMOUNT =Var nearestDate = [NearestDate]ReturnCALCULATE(SUM(Non_FIMI_Data[Amount in EUR]),FILTER (Non_FIMI_Data,Non_FIMI_Data[Date] = nearestDate &&Non_FIMI_Data[Entity Betis Number] = [SelectedBETIS]))