Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

IF statement + Calculated column to calculate average quantity from a different table

Hi everyone,


Here is my sample data:


*Note: The 3rd sheet (Average Quantity) was manually calculated for demonstration purpose only and is not part of my real data


"Compare Data" table:



"Full Data" table:

Vendor NameProduct IDPosting DateOrder
Net Oder QuantityEngine ModelFinal Run Time


1. Can anyone please let me know how I can create a calculated column to calculate Monthly Average Quantity of each product ID in the "Compare Data" table using "Order Quantity" column from the "Full Data" table?


Something like this (please ignore the highlighted cells for now)

















Then, with the calculated column "Average Quantiy", how can I get these averages to automatically compare themselves to their corresponding threhold values from 'Compare Data'[Threshold] and if Average > Threshold, return "Over", otherwise return blank?


My overall aim is show visually only those Product IDs from the 'Compare Data'[ID] that have Average Quantity/month larger than their set threholds. I don't know if that is the right approach to my problem.


How would you approach this problem and what kind of visual do you recommend using?


Can anyone please advise? Thank you very much!





Community Support
Community Support

Re: IF statement + Calculated column to calculate average quantity from a different table



You may try using AVERAGEX and FILTER to add a measure.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors