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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sjpaq
Helper I
Helper I

DAX help please

I have a table called ResponseCosts. There is a column called Hours and another column called Rank. A second table RankHourlyRates keyed on Rank provides the Hourly Rate.

Total cost for a given row = ResponseCosts[Hours] x RankHourlyRates[Hourly Rate]

The following picture shows the relationship between the 2 tables in the model.

sjpaq_0-1708100294334.png

 

I created a new measure in the ResponseCosts table called ExtendedCost to store the total cost (hours * hourlyrate). It is defined as

ExtendedCost =
    SUMX(ResponseCosts, ResponseCosts[Hours] * SUMX(RankHourlyRates, RankHourlyRates[Hourly Rate]))
It is not aggregating properly as in the following table 
sjpaq_1-1708100705112.png

Can anybody help diagnose this? Thanks in advance.

 

 

1 ACCEPTED SOLUTION
sjpaq
Helper I
Helper I

No responses, I think I have figured this out.

I changed the DAX formula to the following:

ExtendedCost =
    SUMX(ResponseCosts, ResponseCosts[Hours] *
            LOOKUPVALUE ('RankHourlyRates'[Hourly Rate],
            'RankHourlyRates'[Rank], [Rank]
 
and it works.

View solution in original post

1 REPLY 1
sjpaq
Helper I
Helper I

No responses, I think I have figured this out.

I changed the DAX formula to the following:

ExtendedCost =
    SUMX(ResponseCosts, ResponseCosts[Hours] *
            LOOKUPVALUE ('RankHourlyRates'[Hourly Rate],
            'RankHourlyRates'[Rank], [Rank]
 
and it works.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.