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

DAX RELATED not working for me

Hi,
i have a fact table which contains many repetitions of a Supply Number with different usage values by date. I have a dim table that contains same supply number and various prices. I want to create a measure that multiplies usage by RElated price.
I can set out a table that lists supply number from fact table and correctly lists the various price elements from theDim table.

however when I try to write a measure
cost = sum(fact[usage])* RELATED(dim[price] it doesn't work. I am advised that the related table can't be found.

any advice gratefully received
Denis

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

@DJBrennan

 

I would iterate over the values of the dim[price] column or the dim table using one of these two measures:

cost =
SUMX ( VALUES ( dim[price] ), dim[price] * CALCULATE ( SUM ( fact[usage] ) ) )

 or

cost =
SUMX ( dim, dim[price] * CALCULATE ( SUM ( fact[usage] ) ) )

 The red part can be replaced with a measure if you have already defined it.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

@DJBrennan

 

In this scenario, since the multiply need to be done on each row level, you need to multiple the RELATED price in SUMX() function.

 

I assume you have table like below:

 

5.PNG

 

You just need to use SUMX() function.

 

Total Cost = SUMX('Fact','Fact'[Usage]*RELATED(Supply[Price]))

6.PNG

 

 

Regards,

View solution in original post

4 REPLIES 4
OwenAuger
Super User
Super User

@DJBrennan

 

I would iterate over the values of the dim[price] column or the dim table using one of these two measures:

cost =
SUMX ( VALUES ( dim[price] ), dim[price] * CALCULATE ( SUM ( fact[usage] ) ) )

 or

cost =
SUMX ( dim, dim[price] * CALCULATE ( SUM ( fact[usage] ) ) )

 The red part can be replaced with a measure if you have already defined it.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn
Phil_Seamark
Microsoft Employee
Microsoft Employee

Have you set up a relationship between the two tables?

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Yes, of course. that's why the table function perfectly. They're related on Supply Number

de ks

@DJBrennan

 

In this scenario, since the multiply need to be done on each row level, you need to multiple the RELATED price in SUMX() function.

 

I assume you have table like below:

 

5.PNG

 

You just need to use SUMX() function.

 

Total Cost = SUMX('Fact','Fact'[Usage]*RELATED(Supply[Price]))

6.PNG

 

 

Regards,

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
Top Kudoed Authors