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

Total with SUM instead of MAX

I have an issue in my data model with calculation of totals.

 

My inputs are following:

- burnt effort per resource and day (in hours)

- scheduling report (roster with resource details)

- rate card with different loaded cost rate (LCR) per each activity type and country

- exchange rate for each currency on monthly level

- mapping table of countries and their currencies

MalyMajo_1-1643908382785.png

I am trying to get the cost calculated in USD, considering that the rates differ every month.

The measure calculates properly on resource level, but not when summing on month level.

 

MalyMajo_0-1643907847880.png

I understand, that the reason is, that the measure calculates MAX of the rate and when all the monthly values are summed, only the highest exchange rate is considered. However, I cannot figure out how to change the measure to SUM the calculations on total level instead of calculating it separately.

I have tried to follow the currency conversion example from DAX Patterns (link).

 

Costs USD:=VAR AggregatedCostsInCurrency =
	ADDCOLUMNS(
		SUMMARIZE(
			Actuals,
			'Calendar'[Year_Month],
			Actuals[Name]
		),
		"@CostsAmountInCurrency",[Costs (internal)],
		"@Rate", CALCULATE(
			MAX(ExchangeRates[Rate]))	
			)
VAR CostUSD =
	SUMX (
		AggregatedCostsInCurrency,
		DIVIDE([@CostsAmountInCurrency],[@Rate])
	)
RETURN
	CostUSD

 Here is the diagram view of my simplified data model:

MalyMajo_2-1643908881002.png


Any help will be appreciated.

 

1 ACCEPTED SOLUTION

PRODUCTX kept giving me same results. However, I have reworked all the measures and it seems to work now.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Most likely you will need to use PRODUCTX  to account for the rate changes.

PRODUCTX kept giving me same results. However, I have reworked all the measures and it seems to work now.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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