Forum Discussion
Total meausre problems
Hi sdb_utd ,
you have to iterate over the VALUES of the Product-column like so:
OMG, you would not believe how frustrating this was. Thanks!
- ImkeF6 years ago
Community Champion
I totally believe you!
Have been there so many times as well...
- sdb_utd6 years agoFrequent Visitor
Last one - I'm trying to get the total working for the start and end cost.
In the table, the values shown are the average start costs for each product. For the total I want the total of the start price, eg. in this case the total start cost should be 305 (sugar on 1st Feb and tea on 2nd Feb)
I don't seem to be able to get the syntax right.
StartCost = VAR datestart = CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Product],'Table'[Date])) return if (HASONEFILTER('Table'[Product]), CALCULATE(average('Table'[Cost]),FILTER(ALL('Table'),'Table'[Date]=datestart)), sumx(VALUES('Table'[Cost]),'Table'[Cost]))- ImkeF6 years ago
Community Champion
Just to be sure (as I find that request a bit strange)
What do you want for Tea?:
1) What shall go into the total: 50 + 55 = 105
2) or actually what you have now: (50 + 55) / 2 = 52.5
And if it is 2: Are you sure that you don't want 107.5?