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
KarlNixon
Advocate I
Advocate I

Measure to convert running balance based on Fx rate

Looking for some help with setting up a measure to convert a running balance based on the Fx rate of the day of the balance date.

 

I have three tables

 

KarlNixon_0-1627626957699.png

 

I have 2 measures

 

Total Amount

 

KarlNixon_3-1627627088017.png

 

Running Balance

 

KarlNixon_2-1627627066348.png

 

 

KarlNixon_1-1627627031150.png

I'm after a measure which multiplies the running balance by the relevant Fx rate 

 

ie for

 

April 2021 = 40,000 x 7.55

May 2021 = 50,000 x 7.54

 

I suspect the answer would be using a TREATAS function but haven't been able to work out the syntax.

 

Any assistance would be greatly appreciated!

 

 

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @KarlNixon ,

1. You can create a relationship between the table DimCalendar and the table fx with the column [date].

vyangliumsft_0-1627888558168.png

2. Create measure.

Running Balance USD =
[Running Balance] * MAX('fx'[fx])

3. Result:

vyangliumsft_1-1627888558189.png

If the result does not meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@KarlNixon , if FX table has unique dates only, you can join on dates and use related to get the fx

 

sumx(balances,related(fx[fx]) *[Amount] )

 

Treatas another option

 

You can copy value to balances

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Thanks amitchandak,

 

But that doesn't seem to work

 

KarlNixon_0-1627630326875.png

 

 

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.