The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Friends,
Sample table here. I need a average from Returns (Qty), Shipped (Qty)
Returns (Qty) : 3296
Shipped (Qty) : 18732408
Rate (%) : 0.21%
Rate (%) =If [Shipped (Qty)]=0 Then 0 Else 12 * [Returns (Qty)] / [Shipped (Qty)] + 0
Can we get average with if Condition like above formula.
Thanks in Advance
Solved! Go to Solution.
@harib - The DIVIDE function has 3 parameters - Numerator, Denominator and Alternate Result. You could create a measure like this:
Rate (%) = var num = SUM([Returns (Qty)]) * 12 var den = SUM([Shipped (Qty)]) return divide(num, den, 0)
Hope this helps,
Nathan
Hi @harib ,
We can also use the IF() function.
Rate (%) = IF ([Shipped (Qty)]=0 , 0 , 12 * DIVIDE([Returns (Qty)] ,[Shipped (Qty)] )+ 0)
Best Regards,
Teige
Hi @harib ,
We can also use the IF() function.
Rate (%) = IF ([Shipped (Qty)]=0 , 0 , 12 * DIVIDE([Returns (Qty)] ,[Shipped (Qty)] )+ 0)
Best Regards,
Teige
@harib - The DIVIDE function has 3 parameters - Numerator, Denominator and Alternate Result. You could create a measure like this:
Rate (%) = var num = SUM([Returns (Qty)]) * 12 var den = SUM([Shipped (Qty)]) return divide(num, den, 0)
Hope this helps,
Nathan