Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ANHAMINE
Regular Visitor

AVERAGEX formula not taking the accurate figures

I want to take Monthly Average of few numbers from a certain date range

 

Both the figures [ Date ] & [ Qty] are available in single table.

 

I am trying to use following formula : 

 

Average Demand = AVERAGEX(VALUES[Table1[Date].[Month]),CALCULATE(SUM(Table1[QTY],DATESBETWEEN[Table1[Date], Start Date , End Date))

 

Output I am getting is simply 'Summation' of Qty , not the 'Monthly Average' as desired.

 

If I remove .[Month] , it gives me certain average but it is based on 'Daily Average' - not 'Monthly' - 

 

Can someone please help in here?

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @ANHAMINE 

you need a dedicated month column to average on, like

Month = FORMAT([Date], "YYYYMM")

 

 

then rewrite the measure like:

Average Demand = AVERAGEX(VALUES[Table1[Month]),CALCULATE(SUM(Table1[QTY],DATESBETWEEN[Table1[Date], Start Date , End Date))

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @ANHAMINE 

you need a dedicated month column to average on, like

Month = FORMAT([Date], "YYYYMM")

 

 

then rewrite the measure like:

Average Demand = AVERAGEX(VALUES[Table1[Month]),CALCULATE(SUM(Table1[QTY],DATESBETWEEN[Table1[Date], Start Date , End Date))

It worked ! You are simply magical 😊

 

Thank you for all your help !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.