Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sking5844
New Member

Error Token Eof in expression

I am geting an error returned on the following expression and I cannot seem to determine why through my research.  The goal of the expression is to ensure the tax lot ID in the table is present for all purchase dates in the table.  It is a consistancy data check.  Here is an example of my expression.

 

Tax Lot Consistency Check =
VAR CurrentTaxLotID = [Tax Lot Id Constant 0]
VAR Current Date = [Business close Date]
VAR DistinctTaxLotIDs =
CALCULATE(DISTINCTCOUNT([Tax Lot Id Constant 0],
FILTER(ALLEXCEPT([Business close Date],
[Business close Date] = CurrentDate))
RETURNIF(DistinctTaxLotIDs = 1, TRUE(), FALSE())

6 REPLIES 6
Anonymous
Not applicable

You are trying to use DAX in a Power Query custom column. You can't do that. Power Query uses M, and the data model uses DAX.

 

--Nate

Anonymous
Not applicable

Hi @sking5844 ,

This is Power Query Editor

vjunyantmsft_0-1722479263599.png

Power Query's backend language is M code, which means it can only recognize M code. but the code you provided is DAX, which are two completely different programming languages.

If you need to use the DAX language, go to Power BI Desktop and create measures, calculated columns, or calculated tables to use.
DAX overview - DAX | Microsoft Learn
Power Query M formula language reference - PowerQuery M | Microsoft Learn

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tob_P
Helper V
Helper V

The error is pointing at the Tax Lot Flag text. Presume it's a custom column and that's what you want to name it as? Would suggest to remove that so your code is just = then your Variables.

Looks like thta just moved the error down some.

Screenshot 2024-07-31 104553.png

Tob_P
Helper V
Helper V

Try taking the space out in your variable name...

 

VAR Current Date = [Business close Date]

No luck, still getting error.

Screenshot 2024-07-31 104553.png

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors