Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Last exchange rate
06-20-2024
05:10 AM
I have a problem with dax in Power Query:
Where null is empty, the new column finds the last course after the date assigned to the corresponding column
The expected effect is the "target column"
PBIX: https://drive.google.com/file/d/1Ywet6f7_poEBmynvGySCMHplnNo3lifV/view?usp=sharing
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024
07:58 PM
Hi @krzysztof ,
You can create a calculated column as below to get it, please find the details in the attachment.
Target Column =
VAR _date = 'Tabela'[Date]
VAR _currency = 'Tabela'[Currency]
VAR _predate =
CALCULATE (
MAX ( 'Tabela'[Date] ),
FILTER (
'Tabela',
'Tabela'[Date] < _date
&& 'Tabela'[Currency] = _currency
&& 'Tabela'[Exchange rate] <> BLANK ()
)
)
VAR _preerate =
CALCULATE (
MAX ( 'Tabela'[Exchange rate] ),
FILTER ( 'Tabela', 'Tabela'[Date] = _predate && 'Tabela'[Currency] = _currency )
)
RETURN
IF ( ISBLANK ( 'Tabela'[Exchange rate] ), _preerate, 'Tabela'[Exchange rate] )
Best Regards
Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2024
07:58 PM
Hi @krzysztof ,
You can create a calculated column as below to get it, please find the details in the attachment.
Target Column =
VAR _date = 'Tabela'[Date]
VAR _currency = 'Tabela'[Currency]
VAR _predate =
CALCULATE (
MAX ( 'Tabela'[Date] ),
FILTER (
'Tabela',
'Tabela'[Date] < _date
&& 'Tabela'[Currency] = _currency
&& 'Tabela'[Exchange rate] <> BLANK ()
)
)
VAR _preerate =
CALCULATE (
MAX ( 'Tabela'[Exchange rate] ),
FILTER ( 'Tabela', 'Tabela'[Date] = _predate && 'Tabela'[Currency] = _currency )
)
RETURN
IF ( ISBLANK ( 'Tabela'[Exchange rate] ), _preerate, 'Tabela'[Exchange rate] )
Best Regards
Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources
Announcements
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Recommendations
Subject | Author | Posted | |
---|---|---|---|
01-26-2025 08:48 AM | |||
01-23-2025 01:45 AM | |||
01-02-2025 04:06 PM | |||
09-04-2024 09:00 AM | |||
02-03-2022 12:13 PM |
Top Solution Authors (Last Month)
User | Count |
---|---|
24 | |
13 | |
10 | |
10 | |
8 |
Top Kudoed Authors (Last Month)
User | Count |
---|---|
16 | |
15 | |
13 | |
12 | |
10 |