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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Asantos2020
Advocate II
Advocate II

Average Price by Territory, Manufacturer, Brand, Product, Date (DAX)

Hello!

I got the following challenge which I haven't been able to overcome:

 

Territory      Fact   Manufacturer     Brand     Product    Date                  Value
North          Value  A                       X             Item1        12/31/2018      $10

South          Qty     A                       X             Item2        11/30/2018         5
North          Qty     B                       Y             Item3         01/31/2019        2

West           Value  C                       Z             Item4         02/28/2018      $11

 

In order to separate Value from Qty, I created 02 measures:

Value$ = CALCULATE(SUM(MarketShare[Value]);MarketShare[Fact] = "Value")
Volume = CALCULATE(SUM(MarketShare[Value]);MarketShare[Fact] = "Qty")

Simply using:

AvgPrice = (CALCULATE([Value$]/ [Volume]))

...gives me the average price, but when it's displayed on matrix table, with brand as rows and territory as columns.

If I want to use it on a bar chart and selected Territory in the Slicer, then I start getting infinity related errors.

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @Asantos2020 ,

 

I modified your measure as belows:

Value$ = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact] = "Value"),VALUES(MarketShare[Territory]))
Volume = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact]="Qty"),VALUES(MarketShare[Territory]))
AvgPrice = DIVIDE([Value$],[Volume])
Result shown as below: (AvgPrice will change based on territory)
02.PNG
Community Support Team _ Dina Ye
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
v-diye-msft
Community Support
Community Support

Hi @Asantos2020 ,

 

I modified your measure as belows:

Value$ = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact] = "Value"),VALUES(MarketShare[Territory]))
Volume = CALCULATE(SUM(MarketShare[Value]),FILTER(ALL(MarketShare),[Fact]="Qty"),VALUES(MarketShare[Territory]))
AvgPrice = DIVIDE([Value$],[Volume])
Result shown as below: (AvgPrice will change based on territory)
02.PNG
Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

What if you used the Divide function instead of "/" ?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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