I have successfully added basic sum/count/etc.. simple measures, but have no idea how to add more complex one.
Let's assume that data structure represent tracks with goods and have next structure:
- date
- id_track
- id_articte
- amount
- cost
And want to calculate next measures:
- average item price, calculated as sum(cost) / sum(amount)
- average track cost. It's average between sum(cost) for whole tracks. Sql expression looks like sum(cost) / count(distinct id_track)
What is the right way to add this measures to my cube, in case i will need them in Excel over XMLA?