Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
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
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |