Forum Discussion
sdb_utd
6 years agoFrequent Visitor
Total meausre problems
Sample PBIX - https://www.dropbox.com/s/vob4ngqfkxt3ss5/TeaSugar_Sample.pbix?dl=0 I've read several posts on this, but it's still not working for me. I'm looking at an invoice table with products...
sdb_utd
6 years agoFrequent Visitor
OMG, you would not believe how frustrating this was. Thanks!
ImkeF
Community Champion
6 years agoI 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?