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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ndris
Helper I
Helper I

Dax multiply column from differents tables

Hello please, I need your help. I have two tables: CashFlow and ExchangesRates
The relationship between the tables is many to many cashflow(exchangeKey) : exchangerates(exchangeKey)   ;(I know it's not recommended so if you have a tip to suggest don't hesitate).

Cashflow

Amount

Opertaiondate

Source_currency

exchangeKey(Opertaiondate_Source_currency)

 

ExchangeRates

Date

Source_currency

Targetcurrency

Rates

exchangeKey(Date_Source_currency)

 

i have create this following measure but it put many time 

measure=SUMX(
SUMMARIZE(
CashFlows
, OperationDate[Date]
, CashFlows[Currency]
, "CommitmentCCY"
, CALCULATE(
SUM(CashFlows[Commitment]) * SUM(ExchangeRates[Rates])
, CashFlows[OperationDate] <= SELECTEDVALUE(ReportingDate[ReportingDate])
, CashFlows[IsInvestorCurrency] = TRUE()
)
)
,[CommitmentCCY]
)

 

I want from my cashflow table to create a measure that will make me calculate for each operationdate multiply amount by the rates(of corresponding exchangeRates, depending on the day and also the targetcurrency selected in my slicer) . there are only 3 targetcurrency (Eur,USD,CHF) and there are several source_currency (AED,EUR,USD,CAD,COP,DEM) .
I could have a solution please?
Thanks in advance

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ndris , A better idea would be have a column or use SUMX and force calculation in expression like a column

 

example

sumx(CashFlows, CashFlows[Commitment] * maxx(filter( ExchangeRates, ExchangeRates[Date] = CashFlows[Date] && ExchangeRates[Currency] = CashFlows[Currency]  ) , ExchangeRates[Rates] )

 

 

Add another filter as per need.

 

But you should create a column, as this will slow down

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ndris , A better idea would be have a column or use SUMX and force calculation in expression like a column

 

example

sumx(CashFlows, CashFlows[Commitment] * maxx(filter( ExchangeRates, ExchangeRates[Date] = CashFlows[Date] && ExchangeRates[Currency] = CashFlows[Currency]  ) , ExchangeRates[Rates] )

 

 

Add another filter as per need.

 

But you should create a column, as this will slow down

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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