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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
zhona9
Resolver I
Resolver I

Error: A function 'FILTER' has been used in a True/False expression that is used as a table filter

I am trying to get the upcoming milestone in a measure.

 

I have a working measure for the last completed milestone that is quite similar, this is the code of the last completed milestone, which is working fine:

 

LastCompletedMilestone = 
var currentproject = selectedvalue('CI Milestones'[ProjectID0])

RETURN
CALCULATE(MAX('CI Milestones'[Title]),
'CI Milestones'[Id]=
MAXX(
    FILTER(ALL('CI Milestones'),'CI Milestones'[ProjectID0]=currentproject && 'CI Milestones'[MilestoneStatus]="Completed"),
    'CI Milestones'[Id])
)

 

This is the code I have for the upcoming milestone, which throws me an error "A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed".

 

Upcoming Milestone = 
var currentproject = selectedvalue('CI Milestones'[ProjectID0])

RETURN
CALCULATE(MIN('CI Milestones'[Title]),
'CI Milestones'[Id]=
MIN(
    FILTER(ALL('CI Milestones'),'CI Milestones'[ProjectID0]=currentproject && 'CI Milestones'[MilestoneStatus]<>"Completed" && 'CI Milestones'[MilestoneStartDate]>TODAY()),
    'CI Milestones'[Id])
)

 

I cannot figure out why this new measure has an error. Kindly assist!

1 ACCEPTED SOLUTION

I removed one of the conditions and now it works:

 

Upcoming Milestone = 
var currentproject = selectedvalue('CI Milestones'[ProjectID0])

RETURN
CALCULATE(MIN('CI Milestones'[Title]),
'CI Milestones'[Id]=
MINX(
    FILTER(ALL('CI Milestones'),'CI Milestones'[ProjectID0]=currentproject && 'CI Milestones'[MilestoneStartDate]>TODAY()),
    'CI Milestones'[Id])
)

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @zhona9 

try first changing the second MIN to MINX in your code?

Thanks for the suggestion. However I encounter the same error. A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

 

Upcoming Milestone = 
var currentproject = selectedvalue('CI Milestones'[ProjectID0])

RETURN
CALCULATE(MIN('CI Milestones'[Title]),
'CI Milestones'[Id]=
MINX(
    FILTER(ALL('CI Milestones'),'CI Milestones'[ProjectID0]=currentproject && 'CI Milestones'[MilestoneStatus]<>"Completed" && 'CI Milestones'[MilestoneStartDate]>TODAY()),
    'CI Milestones'[Id])
)

 

I removed one of the conditions and now it works:

 

Upcoming Milestone = 
var currentproject = selectedvalue('CI Milestones'[ProjectID0])

RETURN
CALCULATE(MIN('CI Milestones'[Title]),
'CI Milestones'[Id]=
MINX(
    FILTER(ALL('CI Milestones'),'CI Milestones'[ProjectID0]=currentproject && 'CI Milestones'[MilestoneStartDate]>TODAY()),
    'CI Milestones'[Id])
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.