Forum Discussion
LorenzoC
2 years agoRegular Visitor
Measure won't work...
Dear All,
i have the following dataset:
| Id | Date | S_Cost | D_Cost | Tot_D_Cost |
| 1 | 01/01/2024 | 500 | 1500 | 3300 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 |
| 2 | 01/02/2024 | 500 | 2100 | 3300 |
| 2 | 02/02/2024 | 500 | 2800 | 3300 |
| 2 | 10/02/2024 | 2000 | 4200 | 2500 |
How can I find the sum of distinct value of S_Cost considering there is only one S_Cost for each Id and Date?
My desired result is:
| Id | Date | S_Cost | D_Cost | Tot_D_Cost | Desired result |
| 1 | 01/01/2024 | 500 | 1500 | 3300 | 2500 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 | 2500 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 | 2500 |
| 2 | 01/02/2024 | 500 | 2100 | 2100 | 3000 |
| 2 | 02/02/2024 | 500 | 2800 | 2800 | 3000 |
| 2 | 10/02/2024 | 2000 | 4200 | 4200 | 3000 |
Thank you
lorenzo
output ;
try the following calculated column :
Column =var ds =CALCULATEtable(SUMMARIZE('Table','Table'[S_Cost],'Table'[Date]) ,ALLEXCEPT('Table','Table'[Id]))
RETURNSUMX(ds,[S_Cost])let me know if this helps.
2 Replies
- Daniel29195Community Champion
output ;
try the following calculated column :
Column =var ds =CALCULATEtable(SUMMARIZE('Table','Table'[S_Cost],'Table'[Date]) ,ALLEXCEPT('Table','Table'[Id]))
RETURNSUMX(ds,[S_Cost])let me know if this helps.- LorenzoCRegular Visitor
Yeah, it does work!
Thanks a lot