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
informer
Helper I
Helper I

DAX - AVERAGEX behaviour incomprehensible !

Hi,

 

2 tables 

Sales rows (please don't focus on values of transaction_id, no consequences on my question)

Calandar

 

I calculated 

Turnover = SUMX('Sales rows', 'Sales rows'[quantity_sold] * 'Sales rows'[unit_price])
Average Daily Turnover EXPR = AVERAGEX(VALUES(dCalendar[transaction_date]), SUMX ('Sales rows','Sales rows'[quantity_sold] * 'Sales rows'[unit_price]))
Average Daily Turnover MESURE = AVERAGEX(VALUES(dCalendar[transaction_date]),[Turnover])
 
And Average Daily Turnover values on charts are just a nonsense because all of them are same with wrong values !
 
I expected for Average Daily Turnover for 
  • 01 january 2019 : 10 = (2*2 + 1*2 + 8*3 )/3 but the result is 30
  • 01 february 2019 : 118= (6*9 + 15*30)/3 but the result is 354
Any idea for helping me to understand the charts belows ?
result-averagex.JPG

Thanks by advanvce for any help !

 
transaction_idOrderDatestore_idcustomer_idproduct_idquantity_soldunit_pricestaff_id
39001/01/201955658222212
122801/01/201955197221230
164402/01/201955247228312
39002/01/201955658226912
122802/01/20195519722201530

 

Calandar

Transaction_Date
01/01/2019
02/01/2019
03/01/2019
04/01/2019
05/01/2019
06/01/2019
07/01/2019
08/01/2019
09/01/2019
10/01/2019
11/01/2019
12/01/2019
13/01/2019
14/01/2019
15/01/2019
16/01/2019
17/01/2019
18/01/2019
19/01/2019
20/01/2019
21/01/2019
22/01/2019
23/01/2019
24/01/2019
25/01/2019
26/01/2019
27/01/2019
28/01/2019
29/01/2019
30/01/2019
31/01/2019
01/02/2019
02/02/2019
03/02/2019
04/02/2019
05/02/2019
06/02/2019
07/02/2019
08/02/2019
09/02/2019
10/02/2019
11/02/2019
12/02/2019
13/02/2019
14/02/2019
15/02/2019
16/02/2019
17/02/2019
18/02/2019
19/02/2019
20/02/2019
21/02/2019
22/02/2019
23/02/2019
24/02/2019
25/02/2019
26/02/2019
27/02/2019
28/02/2019
1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @informer 

 

please check if this accomodate your need.

Irwan_0-1754888238292.png

 

 
i am not sure the result doesnt match to what you state above.

Based on your sample data above,

1-Jan should be 3 as (2*2+1*2)/2

2-Jan should be 126 (8*3+6*9+20*15)/3

 

create a measure with following DAX.

Average =
AVERAGEX(
    'Table',
    'Table'[quantity_sold]*'Table'[unit_price]
)
 
Hope this will help.
Thank you.

View solution in original post

3 REPLIES 3
Irwan
Super User
Super User

hello @informer 

 

please check if this accomodate your need.

Irwan_0-1754888238292.png

 

 
i am not sure the result doesnt match to what you state above.

Based on your sample data above,

1-Jan should be 3 as (2*2+1*2)/2

2-Jan should be 126 (8*3+6*9+20*15)/3

 

create a measure with following DAX.

Average =
AVERAGEX(
    'Table',
    'Table'[quantity_sold]*'Table'[unit_price]
)
 
Hope this will help.
Thank you.

Hi Irwan,
Thanks so much for your help and solution which is absolutly strategic for me. 👍🤜🤛

You make my day 😎

Hello @informer 

 

Glad to be a help.

Thank you.

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.