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
Anonymous
Not applicable

Grouping

Hello,
So I need help with calculation.

Table has many columns. One of them is order number (one number is repeted but has different data). Just example:

Order NRClientPrice
214a30
214b10
215c20
216d10
216e40

Average price = 22
Average price for Order nr = (30+10)+20+(10+40) / 3 =36.6

 
Price is a calculated column.
I need to know what is the average Price for the ORDER NUMBER 
Thanks for help
Aleks

 

2 ACCEPTED SOLUTIONS
johnt75
Super User
Super User

Try

Avg Price per order number =
AVERAGEX (
    ADDCOLUMNS (
        VALUES ( 'Table'[Order number] ),
        "@val", CALCULATE ( SUM ( 'Table'[Price] ) )
    ),
    [@val]
)

View solution in original post

Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

Measure:

Measure =
var _sum=SUMX(ALL('Table'),[Price])
var _count=CALCULATE(DISTINCTCOUNT('Table'[Order NR]),ALL('Table'))
return
DIVIDE(_sum,_count)

Calculated column:

Column =
var _sum=SUMX(ALL('Table'),[Price])
var _count=DISTINCTCOUNT('Table'[Order NR])
return
DIVIDE(_sum,_count)

Result:

vyangliumsft_0-1670561033135.png

 

Best Regards,

Liu Yang

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  @Anonymous ,

 

Here are the steps you can follow:

Measure:

Measure =
var _sum=SUMX(ALL('Table'),[Price])
var _count=CALCULATE(DISTINCTCOUNT('Table'[Order NR]),ALL('Table'))
return
DIVIDE(_sum,_count)

Calculated column:

Column =
var _sum=SUMX(ALL('Table'),[Price])
var _count=DISTINCTCOUNT('Table'[Order NR])
return
DIVIDE(_sum,_count)

Result:

vyangliumsft_0-1670561033135.png

 

Best Regards,

Liu Yang

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

johnt75
Super User
Super User

Try

Avg Price per order number =
AVERAGEX (
    ADDCOLUMNS (
        VALUES ( 'Table'[Order number] ),
        "@val", CALCULATE ( SUM ( 'Table'[Price] ) )
    ),
    [@val]
)

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.