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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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