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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
greVia
New Member

Revenue in matrix

Hello,

 

I need to have a matrix with total revenue measure as Revenue =Unit_Price*Quantity the problem is that these fields are in two differente table.

My db is:

OrdersordersRowOrdersShipped
OrderNumber(1)OrderNumber(m)Index(m)
Customer NameIndex(1)Quantity_Shipped
WBSPart_numberShipping_Date
 Quantity 
 TotalValue 
 UnitPrice (useless) 

 

My idea was to use this measure in Matrix: 

revenue= SUM(OrdersRows[TotalValue])/SUM(OrdersRows[Quantity])*SUM(Ordershipped[Quantity_Shipped])
it is right (it should)  with row but it is totally wrong with subtotal and total.
 
Could you please help me?
 
many thanks
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@greVia , Multiplication should done at line or you need have common group like order no

revenue= divide(SUM(OrdersRows[TotalValue]),Sumx(values(Order[Order]),calculate(SUM(OrdersRows[Quantity])*SUM(Ordershipped[Quantity_Shipped]))))

 

refer by the blog for a common level between two tables

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

I solved the problemi with 

SUMX(Ordershipped,Ordershipped[Quantity]*RELATED(OrdersRows[UnitPrice]))
 
thank  your reply i found the solution many thanks

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@greVia , Multiplication should done at line or you need have common group like order no

revenue= divide(SUM(OrdersRows[TotalValue]),Sumx(values(Order[Order]),calculate(SUM(OrdersRows[Quantity])*SUM(Ordershipped[Quantity_Shipped]))))

 

refer by the blog for a common level between two tables

https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-2-Date-Differ...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I solved the problemi with 

SUMX(Ordershipped,Ordershipped[Quantity]*RELATED(OrdersRows[UnitPrice]))
 
thank  your reply i found the solution many thanks

I read part of your blog it is so interesting, thanks.  

But I have some doubts:

1) Multiplication should done at line" It means that I should create a column? I didn't understand

2)What is common group (I am looking for on internet but I am not finding), if I use this common group then I can use your formula?

 

Sorry for questions and thanks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors