Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I want to calculate the average of the Values if the Parameter field is "Gross Profit" else calculate the sum of the Values, which is like shown below;
Net = IF(POC[Parameter] = "Gross Profit", AVERAGE(POC[Value]), Sum(POC[Value]))
But Power Bi doesn't allow me to create a measure with my expression. What wrong I am doing here?
any help is appreciated
thanks
Solved! Go to Solution.
hi, @Anonymous
You could use SELECTEDVALUE Function in you formula as below:
Net = IF(SELECTEDVALUE(POC[Parameter]) = "Gross Profit", AVERAGE(POC[Value]), Sum(POC[Value]))
Result:
Basic data
Best Regards,
Lin
hi, @Anonymous
You could use SELECTEDVALUE Function in you formula as below:
Net = IF(SELECTEDVALUE(POC[Parameter]) = "Gross Profit", AVERAGE(POC[Value]), Sum(POC[Value]))
Result:
Basic data
Best Regards,
Lin