Return of Qty where CRD is the minimum

Hello all,

I will need your help to finalize and fine-tune my formula.
My report is containing lots of data but there is one record for each [EC].[Material].
With below formula I am getting the sum of all materials minimum CRD dates, and not for the material only.
What do I need to change to get the on material level only?

=[Qty] Where ([Dist EC CRD] = Min([Dist EC CRD]) In ([EC].[Material])) In ([EC].[Material])

Thanks in advance

Hello again,
I think I found a first hint… the function Min is converting it to a measure by default and this might be one part of the issue.
Even so I am not sure if this is really the issue as above formula is summing up all quantities of all materials which somehow works, except that I want to get the quantity on material only and not all.

In case you have any ideas or advices, I will appreciate it. Thanks a lot