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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Robert-bpd
New Member

Average value not using row count

Hi,

I have a table structure like this:

Table: Order

OrderIdQuantity
110
22

 

Table: OrderItem

OrderIdItemIdValue
1115
126
2112

 

Table: Item

ItemIdName
1Door
2Window

 

Now I want to have a visual to show the average sold value of the items. But it should take the quantity into account:

ItemAverage value
Door(15*10 + 12*2) / 12 = 14.5
Window(6*10) / 10 = 6

 

How can  I create the "Average value" column?

 

Thx!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@Robert-bpd 

as I could imagine you need smth like

Column = DIVIDE(calculate(SUMX('Table (2)', 'Table (2)'[Value]*RELATED('Table'[Quantity]))), calculate(SUMX('Table (2)', 'Table (2)'[Value])))

but you need check columns depending on your business logic


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

@Robert-bpd 

as I could imagine you need smth like

Column = DIVIDE(calculate(SUMX('Table (2)', 'Table (2)'[Value]*RELATED('Table'[Quantity]))), calculate(SUMX('Table (2)', 'Table (2)'[Value])))

but you need check columns depending on your business logic


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thx! @az38 and @Anonymous 

 

I believe this would be the correct version:

Test = DIVIDE(CALCULATE(SUMX(OrderItem; OrderItem[Value] * RELATED(Order[Quantity]))); CALCULATE(SUMX(OrderItem; RELATED( Order[Quantity]))))

 

 

Anonymous
Not applicable

@az38, do you need calculate around the SUMX expressions? If so, why?

 

@Robert-bpd, az38:s solutions looks good, but of course it requires proper releations between the tables.

az38
Community Champion
Community Champion

@Robert-bpd 

whydo you divide Door by 12?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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