March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi,
I have a fact table like the one below. I need to create a measure calculating the average value of order (OrderKey)
OrderNumber | CustomerCountry | OrderType | ProductNumber | SalesQuantity | SalesRevenue | OrderKey |
1 | US | XX | xc1353 | 56 | 42,540 | 1USXX |
1 | US | XX | vf4535 | 4 | 2,576 | 1USXX |
1 | US | XX | hg3563 | 44 | 45,562 | 1USXX |
1 | US | XX | kj7898 | 12 | 12,354 | 1USXX |
2 | UK | KY | vf4535 | 12 | 7,728 | 2UKKY |
2 | UK | KY | hg3563 | 123 | 127,367 | 2UKKY |
2 | UK | KY | kj7898 | 35 | 36,033 | 2UKKY |
Would you help?
Solved! Go to Solution.
try this:
Avg Order Revenue =
AVERAGEX (
DISTINCT ( 'Table'[OrderKey] ),
CALCULATE ( SUM ( 'Table'[SalesRevenue] ) )
)
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]
)
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.
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]
)
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.
try this:
Avg Order Revenue =
AVERAGEX (
DISTINCT ( 'Table'[OrderKey] ),
CALCULATE ( SUM ( 'Table'[SalesRevenue] ) )
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |