Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |