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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
samc_26
Helper IV
Helper IV

Averaging averages by Date and then Product in variable

So I have three columns, a date, product and value column and I've got an average for these costs monthly but BI is adding up the average by product first and then averaging those averages across the date. What I want is to calculate an average by date and then an average of those averages across the products. I tried to write out some variables with the usual calculate(average(Table[Value]), filter(Table[Product] = "Book")) and then repeat this for each product to then calculate these averages but it keeps telling me the 'syntax for ')' is incorrect and I don't know what that means 😞 

 

If anyone can understand my explanation and work this out I would be grateful! Thank you!

 

1 ACCEPTED SOLUTION
Shahid12523
Community Champion
Community Champion

To average by Date first, then average those across Products, use this pattern:
AverageByDateThenProduct :=
AVERAGEX(
VALUES(SalesData[Date]),
CALCULATE(AVERAGE(SalesData[Value]))
)


This gives you the average of daily averages, not the average of all values. If you want to do this per product, wrap it in another AVERAGEX over VALUES(SalesData[Product]).

Shahed Shaikh

View solution in original post

5 REPLIES 5
v-sdhruv
Community Support
Community Support

Hi @samc_26 ,
Since we didnt hear back, we would be closing this thread.
If you need any assistance, feel free to reach out by creating a new post.

Thank you for using Microsoft Community Forum

v-sdhruv
Community Support
Community Support

Hi @samc_26 ,

Can you please provide your full DAX measure so that we can help you modify to achieve the right solution.
Thank You

v-sdhruv
Community Support
Community Support

Hi @samc_26 ,

Can you please provide your full DAX measure so that we can help you modify to achieve the right solution.
Additionally, you might want to check how AverageX function works
AVERAGEX function (DAX) - DAX | Microsoft Learn
The AVERAGEX function can take  its argument an expression that is evaluated for each row in a table. This enables you to perform calculations and then take the average of the calculated values.

Hope this helps!


Shahid12523
Community Champion
Community Champion

To average by Date first, then average those across Products, use this pattern:
AverageByDateThenProduct :=
AVERAGEX(
VALUES(SalesData[Date]),
CALCULATE(AVERAGE(SalesData[Value]))
)


This gives you the average of daily averages, not the average of all values. If you want to do this per product, wrap it in another AVERAGEX over VALUES(SalesData[Product]).

Shahed Shaikh
FBergamaschi
Solution Sage
Solution Sage

Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Alternatively, you can share your .pbix via some cloud service and paste the link here. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors