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
mbbzoh
Frequent Visitor

Average price per product based on slicer

Hi, 

 

I have table with columns

ProductIDShopPrice
1aaa10
1bbb5
1ccc8
2aaa20
2bbb15
2ccc17
2eee14

 

I want to calculate a measure which show me average price per product based on slicer with shop.

It could be something like below:

1) For slicer shops in aaa & bbb

ProductIDAvgPrice
17,5
217,5

 

I've tried everithing what i know so please help someone 🙏

1 ACCEPTED SOLUTION

Hi @mbbzoh ,

 

For your first table make sure you use the table visual:

GeorgeColl_7-1746107719917.png

 

Then insert your fields as follows:

 

GeorgeColl_2-1746107421181.png

 

Where the following measures are defined as follows:

 

Sum of Shop Price = CALCULATE(
    SUM('Revised Data'[Shop price]))
AveragePrice = CALCULATE(
    AVERAGE('Revised Data'[Shop price]),
    FILTER(ALL('Revised Data'), 
        'Revised Data'[Product] = SELECTEDVALUE('Revised Data'[Product])
        ))
Sum of Volume = CALCULATE(
    SUM('Revised Data'[Volume my shop]))
Sum of Weight = CALCULATE(
    SUM('Revised Data'[Weight]))

 

This gives your first table.

 

For your second table, use the matrix visual

GeorgeColl_3-1746107572203.png

 

With your fields as follows:

GeorgeColl_5-1746107630145.png

 

 

Where VolumeRatio is a measure defined as:

VolumeRatio = CALCULATE(
    DIVIDE([Sum of Weight],[Sum of Volume], 0))

 

This will then give you the following final results: 

GeorgeColl_6-1746107687048.png

View solution in original post

5 REPLIES 5
v-venuppu
Community Support
Community Support

Hi @mbbzoh ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

mbbzoh
Frequent Visitor

Thank you  ,but maybe i didn't explain it well. I need this average price to calculate ratio shop's price vs average price for all product separetly.

So in first step i need to have Averave product price like below: 

Shop

Product

Shop price

Average product price

Ratio
(shop price/average price)

Volume my shop

Weight

1

aaa

10,00

15,00

0,67

10

6,67

2

aaa

20,00

15,00

1,33

10

13,33

1

bbb

5,00

10,00

0,50

15

7,50

2

bbb

15,00

10,00

1,50

15

22,50

1

ccc

8,00

12,50

0,64

5

3,20

2

ccc

17,00

12,50

1,36

5

6,80

2

eee

14,00

14,00

1,00

7

7,00

 

In second step i want to calculate weighted average for all shops based on ratio and volume my shop and get something like that in visual table::

Shop

Sum Weight

Sum Volume

Ratio (weight/volume)

1

17,36667

30

58%

2

49,63333

37

134%

 

Hi @mbbzoh ,

 

For your first table make sure you use the table visual:

GeorgeColl_7-1746107719917.png

 

Then insert your fields as follows:

 

GeorgeColl_2-1746107421181.png

 

Where the following measures are defined as follows:

 

Sum of Shop Price = CALCULATE(
    SUM('Revised Data'[Shop price]))
AveragePrice = CALCULATE(
    AVERAGE('Revised Data'[Shop price]),
    FILTER(ALL('Revised Data'), 
        'Revised Data'[Product] = SELECTEDVALUE('Revised Data'[Product])
        ))
Sum of Volume = CALCULATE(
    SUM('Revised Data'[Volume my shop]))
Sum of Weight = CALCULATE(
    SUM('Revised Data'[Weight]))

 

This gives your first table.

 

For your second table, use the matrix visual

GeorgeColl_3-1746107572203.png

 

With your fields as follows:

GeorgeColl_5-1746107630145.png

 

 

Where VolumeRatio is a measure defined as:

VolumeRatio = CALCULATE(
    DIVIDE([Sum of Weight],[Sum of Volume], 0))

 

This will then give you the following final results: 

GeorgeColl_6-1746107687048.png

mbbzoh
Frequent Visitor

Thank you @GeorgeColl ,but maybe i didn't explain it well. I need this average price to calculate ratio shop's price vs average price for all product separetly.

So in first step i need to have Averave product price like below: 

 

ShopProductShop priceAverage product priceRatio
(shop price/average price)
Volume my shopWeight
1aaa10,0015,000,67106,67
2aaa20,0015,001,331013,33
1bbb5,0010,000,50157,50
2bbb15,0010,001,501522,50
1ccc8,0012,500,6453,20
2ccc17,0012,501,3656,80
2eee14,0014,001,0077,00

 

In second step i want to calculate weighted average for all shops based on ratio and volume my shop and get something like that in visual table::

ShopSum WeightSum VolumeRatio (weight/volume)
117,366673058%
249,6333337134%
GeorgeColl
Helper II
Helper II

Hi @mbbzoh

 

You can use the measure below to calculate the average price, if you then add a slicer for "Shop" you will get the result requested. 

 

AvgPrice = CALCULATE(
    AVERAGE('Table'[Price]))

 

GeorgeColl_0-1745941206575.png

 

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.