Forum Discussion
Syndicate_Admin
2 years agoAdministrator
Single cost calculation for multiple orders
Hello I have a table with orders in different statuses and I need to calculate the cost only once for each order but I don't get it right. When I put this expression at the column level, it work...
Syndicate_Admin
2 years agoAdministrator
Hello
This is the table, as you can see the cost column is where the formula is:
Cost = CALCULATE(SUM(Price[Price])*sum(Touched[may-24])*sum(Agencies[Department])*SUM(AHT[may-24]), Agencies[Agency]="Marktel",Price[Agency] = "Marktel")+
CALCULATE(SUM(Price[Price])*sum(Touched[may-24])*sum(Agencies[Department])*SUM(AHT[may-24]), Agencies[Agency]="Bosch",Price[Agency] = "Bosch")
And it does the calculation well, but when I take the model it brings me 2 times the cost for the same order, so I have tried to make this measurement:
Provi Ribs = sumx(Sales,CALCULATE(SUM(Price[Price])*sum(Touched[may-24])*sum(Agencies[Department])*SUM(AHT[may-24]), Agencies[Agency]="Marktel",Price[Agency] = "Marktel", DISTINCT(Sales[OT No.])))+sumx(Sales,CALCULATE(SUM(Price[Price])*sum(Touched[may-24])*sum(Agencies[Department])*SUM(AHT[may-24]), Agencies[Agency]="Bosch",Price[Agency] = "Bosch", DISTINCT(Sales[OT No.])))
But it's still doubling the cost.