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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.