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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors