Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I tried to find a solution for this problems in the forum but I couldn't.
I have 2 tables in my BI report, one is SO (Sales Orders) and another one is Exchange Rates.
In the sales orders table we have the revenue generated in a specific date (Invoice Date) and in a specific currency (Order Cur Code). I am trying to build a Dax formula to get the exchange rate for that specific date and currency in the Exchange rates table, when it is not USD. So far, what I got is:
Solved! Go to Solution.
HI @omaffud ,
You can try to use following calculate column formula to lookup closed date based on current row contents:
Formula =
VAR _closedate =
CALCULATE (
MAX ( 'Exchange Rates'[Effective Date] ),
FILTER (
ALLSELECTED ( 'Exchange Rates' ),
'Exchange Rates'[Effective Date] <= EARLIER ( 'SO'[Invoice Date] )
&& 'Exchange Rates'[To Curr] = EARLIER ( 'SO'[Order Cur Cod] )
)
)
RETURN
LOOKUPVALUE (
'Exchange Rates'[Exchange Rate],
'Exchange Rates'[Effective Date], _closedate,
'Exchange Rates'[To Curr], 'SO'[Order Cur Cod]
)
Regards,
Xiaoxin Sheng
HI @omaffud ,
You can try to use following calculate column formula to lookup closed date based on current row contents:
Formula =
VAR _closedate =
CALCULATE (
MAX ( 'Exchange Rates'[Effective Date] ),
FILTER (
ALLSELECTED ( 'Exchange Rates' ),
'Exchange Rates'[Effective Date] <= EARLIER ( 'SO'[Invoice Date] )
&& 'Exchange Rates'[To Curr] = EARLIER ( 'SO'[Order Cur Cod] )
)
)
RETURN
LOOKUPVALUE (
'Exchange Rates'[Exchange Rate],
'Exchange Rates'[Effective Date], _closedate,
'Exchange Rates'[To Curr], 'SO'[Order Cur Cod]
)
Regards,
Xiaoxin Sheng
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |