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

Exchange rates for the weekend

Hello everyone,

 

I´m working right now on a Currency Conversion. This works so far and i can change several currencies based on the change rates into the home currency EURO, also related to the specific date.

 

My problem right now is that i have all the exchange rates for all the different currencies i want to convert, but the exchange rates are just available from Monday- Friday. 

 

In my case it is now possible that there are values i have to convert which are created on a weekend. For Example a Spare Part which has been sold on Saturday. Unfortunately with my current conversion i just cover the Values which are created between monday-friday because the Conversion is based on the Date.

 

I tried several things to get this Issue solved but nothing worked. 

So my Question now is there any possibility that i can use the last exisiting exchange rate ? For example when there is a Spare part sold on Saturday it just takes the exchange rate from Friday? 

I tried it with the function Lastnonblank but i was not able to get it done with this function.

 

Below you can see my current conversion which is working except for the weekends because of the missing exchange rates.

 

SalesAmountSpareParts = SUMX(SpareParts;
                 Divide(SpareParts[Amount];
                    LOOKUPVALUE(ExchangeRates[ExchangeRate];ExchangeRates[Date];SpareParts[Date];                          
                  ExchangeRates[Currency];SpareParts[Currency])))                       
  
+                        Calculate(Sum(SpareParts[Amount]);
                                    FILTER(SpareParts;SpareParts[Currency]="EUR"))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@heldus  - 

In Power Query, you can do the following:

1. Right Outer Join with your Date table. This will add dates that don't exist yet in your exchange rate table.

2. Order by your new date column.

3. Fill values downwards.

4. Delete your old date column.

Cheers!

Nathan

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@heldus  - 

In Power Query, you can do the following:

1. Right Outer Join with your Date table. This will add dates that don't exist yet in your exchange rate table.

2. Order by your new date column.

3. Fill values downwards.

4. Delete your old date column.

Cheers!

Nathan

Hi Nathan,

How do you fill values downwards? Manualy? 

Thanks

Hi @Anonymous ,

 

thank you for your answer.

 

I tried it and it works, but do you know how i can handle this if I have tables like the currency rate which get updated with the new rate ervery day?

 

I think it doesn´t fill up the new blank rows automatically ?

 

Best regards 

Anonymous
Not applicable

@heldus - If your data source is updated, it should come through and work when refreshed. Please share your pbix if it doesn't work.

Cheers!

Nathan

@Anonymous 

 

Thank you for your help.

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.