
1. Re: Calculating Segment with Weighted average price
Stoyko Kostov Aug 1, 2016 2:07 PM (in response to Cyrille Thybert)1 of 1 people found this helpfulHi Cyrille,
Please try this definition for WAP HIGH:
{fixed [Date]:
sum(if [Price]> ([WAP  Fixed]) then [Sales Value] else 0 end)
/sum(if [Price]> ([WAP  Fixed]) then [Sales Unit] else 0 end)}
It shows the value you are concerned about at 24.708.
Hope this helps!

2. Re: Calculating Segment with Weighted average price
hannah.johnson Aug 1, 2016 6:38 PM (in response to Cyrille Thybert)1 of 1 people found this helpfulThis formula should work as well.
if SUM([Price]) > SUM({fixed [Date] : sum([Sales Value])/sum([Sales Unit])})
then sum([Sales Value])/sum([Sales Unit])
end
It is slightly modified from what you had originally, just combining the two LOD expressions into one and aggregating the LOD and Price. The aggregation issue was happening before because the LOD expression needed to be aggregated and the [Price] also needs to be aggregated. If one measure/dimension is aggregated in a calculated field, all measures/dimensions must be aggregated. The follow article goes into further detail about resolving aggregation issues:
Resolving "Cannot mix aggregate and nonaggregate arguments" Calculation Error  Tableau Software
Cheers!
Hannah @tableau

3. Re: Calculating Segment with Weighted average price
Cyrille Thybert Aug 11, 2016 1:38 AM (in response to Cyrille Thybert)Thank you both !!!
all working.