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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Gilad
Frequent Visitor

calculated measure between to fact tables related with a dimension table

Hello  ,

I am having issue creating a calculated measure between to fact tables related with a dimension table .

relationship 1: dim company key + item key = fact sales item key+fact sales company key

relationship 2: dim item key = fact cost item key

Items can be sold in each company but the cost is unique for each item cross companies.

I need to calculate unit cost * quantity

sum(unit cost) * sum(quantity) result to be correct at item key level but the total is wrong , 

please advice

Screenshot 2023-10-25 094541.png

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Gilad ,

try write your measure like:

Cost Measure = 
SUMX(
    sales,
    sales[quantity]*RELATED(cost[Unit Cost])
)

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Gilad 

 

Has your problem been solved yet? If not, can you tell what kind of output you expect based on the data you provided?

 

Best Regards,

Community Support Team _Charlotte

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

FreemanZ
Super User
Super User

hi @Gilad ,

try write your measure like:

Cost Measure = 
SUMX(
    sales,
    sales[quantity]*RELATED(cost[Unit Cost])
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.