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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
zirael
Regular Visitor

DAX Measure for Revenue average by Order

Hi,

 

I have a fact table like the one below. I need to create a measure calculating the average value of order (OrderKey)

 

OrderNumberCustomerCountryOrderTypeProductNumberSalesQuantitySalesRevenueOrderKey
1USXXxc13535642,5401USXX
1USXXvf453542,5761USXX
1USXXhg35634445,5621USXX
1USXXkj78981212,3541USXX
2UKKYvf4535127,7282UKKY
2UKKYhg3563123127,3672UKKY
2UKKYkj78983536,0332UKKY

 

Would you help?

2 ACCEPTED SOLUTIONS
Stachu
Community Champion
Community Champion

try this:

Avg Order Revenue = 
AVERAGEX (
    DISTINCT ( 'Table'[OrderKey] ),
    CALCULATE ( SUM ( 'Table'[SalesRevenue] ) )
)

20221017_avg.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

Anonymous
Not applicable

Hi @zirael ,

Please have a try.

Create a measure.

ave_measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[OrderNumber] = SELECTEDVALUE ( 'Table'[OrderNumber] )
    ),
    'Table'[SalesRevenue]
)

Or a column.

ave =
AVERAGEX (
    FILTER ( 'Table', 'Table'[OrderNumber] = EARLIER ( 'Table'[OrderNumber] ) ),
    'Table'[SalesRevenue]
)

 

vpollymsft_0-1666070399616.png

 

 

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @zirael ,

Please have a try.

Create a measure.

ave_measure =
AVERAGEX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[OrderNumber] = SELECTEDVALUE ( 'Table'[OrderNumber] )
    ),
    'Table'[SalesRevenue]
)

Or a column.

ave =
AVERAGEX (
    FILTER ( 'Table', 'Table'[OrderNumber] = EARLIER ( 'Table'[OrderNumber] ) ),
    'Table'[SalesRevenue]
)

 

vpollymsft_0-1666070399616.png

 

 

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Stachu
Community Champion
Community Champion

try this:

Avg Order Revenue = 
AVERAGEX (
    DISTINCT ( 'Table'[OrderKey] ),
    CALCULATE ( SUM ( 'Table'[SalesRevenue] ) )
)

20221017_avg.PNG



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.