Forum Discussion
Custom column to identify changes between two datasets
- 9 months ago
Hi 161521144121144 ,
The Token Eof expected error usually happens when there’s a small syntax issue in your DAX formula like missing line breaks, extra spaces, or parentheses that don’t match. In your case, it looks like the problem might have come from how the line breaks or indentation got copied over.
Below is a cleaned up version of your formula that should work if you paste it directly into a Power BI calculated column:
Status =
VAR MatchRow =
LOOKUPVALUE(
Data_2025[Weight source],
Data_2025[Product code], Data_2024[Product code],
Data_2025[Product description], Data_2024[Product description],
Data_2025[Attribute], Data_2024[Attribute]
)
RETURN
IF(
ISBLANK(MatchRow),
"not found",
IF(MatchRow = Data_2024[Weight source], "unchanged", "changed")
)
Hi 161521144121144 ,
I have replicated this scenario using sample data with the following columns: Product code, Product description, Attribute, and Weight source.
Compare the 2024 and 2025 datasets to identify any changes in the Weight source field. Import both Data_2024 and Data_2025 tables into Power BI. Confirm both tables are included in the data model. Create a new calculated column in Data_2024 as follows:
Status =
VAR MatchRow =
LOOKUPVALUE(
Data_2025[Weight source],
Data_2025[Product code], Data_2024[Product code],
Data_2025[Product description], Data_2024[Product description],
Data_2025[Attribute], Data_2024[Attribute]
)
RETURN
IF(
ISBLANK(MatchRow), "not found",
IF(MatchRow = Data_2024[Weight source], "unchanged", "changed")
)
The LOOKUPVALUE() function searches for a corresponding row in Data_2025 based on Product code, Product description, and Attribute. If no match is found, the status is not found. If the Weight source values are identical, the status is unchanged. Otherwise, it is marked as changed.
Please find the attached .pbix file for your reference.
Thank you. Trying to repeat the formula gives Token Eof expected for the MatchRow after VAR
- v-sshirivolu9 months agoCommunity Support
Hi 161521144121144 ,
The Token Eof expected error usually happens when there’s a small syntax issue in your DAX formula like missing line breaks, extra spaces, or parentheses that don’t match. In your case, it looks like the problem might have come from how the line breaks or indentation got copied over.
Below is a cleaned up version of your formula that should work if you paste it directly into a Power BI calculated column:
Status =
VAR MatchRow =
LOOKUPVALUE(
Data_2025[Weight source],
Data_2025[Product code], Data_2024[Product code],
Data_2025[Product description], Data_2024[Product description],
Data_2025[Attribute], Data_2024[Attribute]
)
RETURN
IF(
ISBLANK(MatchRow),
"not found",
IF(MatchRow = Data_2024[Weight source], "unchanged", "changed")
)