Forum Discussion
MarcRapenne
6 years agoFrequent Visitor
Deaveraging prices
Hello! I am pretty new to Dax and need help with the below problem: I have a series of products with unique serial numbers that have been bought in a LOT at an average price of X / Unit ( in...
V-lianl-msft
6 years agoCommunity Support
Hi MarcRapenne ,
You can try the DAX like below:
Column =
VAR COUNT_ID =CALCULATE( COUNT('Table'[ID]),FILTER('Table','Table'[ID]<>"NF"))
VAR SUM_PRICE =SUM('Table'[Price])
VAR _50 = 0.5*'Table'[Price]
RETURN IF('Table'[ID]="NF",_50,(SUM_PRICE-_50)/COUNT_ID)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.