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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Lightice83
Helper I
Helper I

Reference fact/data table from Dimension table

Hi,

 

I'm doing the Mavern Analytics advanced DAX course & there is a example where we create a calculated column in the Fact/Lookup table for Customers to return total revenue (for all customers) from the Sales table Fact/Data table (this is being used as a input to a bigger calculation) into the Dimension/Lookup table

 

The calculation used is SUMX (see below) but would this not calculate the revenue per customer not all customers?  Or is it because there has been no context transition (starting with row context & not used calculate) hence it is just doing the SUMX over every customer?

 

Thanks

 

Mavern Example.PNG

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Lightice83,

 

The SUMX in the example would return the same amount for each customer, because it is iterating the entire fact table without regard to the relationship between Customers and Sales by Store. However, if you add RELATEDTABLE it will filter the fact table per the relationship with Customers:

 

SUMX (
    RELATEDTABLE ( 'Sales by Store' ),
    'Sales by Store'[quantity_sold] * 'Sales by Store'[unit_price]
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@Lightice83,

 

The SUMX in the example would return the same amount for each customer, because it is iterating the entire fact table without regard to the relationship between Customers and Sales by Store. However, if you add RELATEDTABLE it will filter the fact table per the relationship with Customers:

 

SUMX (
    RELATEDTABLE ( 'Sales by Store' ),
    'Sales by Store'[quantity_sold] * 'Sales by Store'[unit_price]
)

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.