Forum Discussion
talita19ny
4 years agoFrequent Visitor
Summing only first value across a specific group
Hello,
I'm trying to get a total sum for fees that are paid per user card transaction. However the dataset lists all items per transaction and includes the fee on all lines. The correct calculation for this would be taking only one fee per transaction and not per line. I would then need to add all the fees for the different transactions. transaction. How could I calculate this? The image below highlights what needs to be added. I hope this makes sense and any help is much appreciated.
Thanks
Hi, talita19ny
Try formulas as below:
Measure:
Rank = RANKX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Transactions ID] = MAX ( 'Table'[Transactions ID] ) ), CALCULATE ( MAX ( 'Table'[Column3] ) ), , ASC )New Fee = IF ( [Rank] = 1, SUM ( 'Table'[Fee] ), BLANK () )Best Regards,
Community Support Team _ Eason
2 Replies
- amitchandak
Super User
- v-easonf-msft
Community Support
Hi, talita19ny
Try formulas as below:
Measure:
Rank = RANKX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Transactions ID] = MAX ( 'Table'[Transactions ID] ) ), CALCULATE ( MAX ( 'Table'[Column3] ) ), , ASC )New Fee = IF ( [Rank] = 1, SUM ( 'Table'[Fee] ), BLANK () )Best Regards,
Community Support Team _ Eason