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
Clint
Helper V
Helper V

Using multiple criteria to build calculated table

Hello,

 

I am trying to build a calculated table (based on my Tasks table) that returns tasks based on two criteria:
1. The task is 100% complete OR

2. The task finish date is in the past <Today()

 

The following DAX works  but only returns things that are complete and in the past:

Tasks Closed or Overdue =

CALCULATETABLE('Tasks',

FILTER(

'tasks',Tasks[Task Percent Completed]=100),

FILTER(

'Tasks','Tasks'[Task Finish Date]<TODAY())

)

when I try to use OR, I get an error about multiple columns being referenced

Tasks Closed or Overdue =

CALCULATETABLE('Tasks',

or(

'tasks',Tasks[Task Percent Completed]=100),

'Tasks','Tasks'[Task Finish Date]<TODAY())

 

What's confusing about the DAX is, I have a table that only shows Tasks that have a finish date between Today+30 and today+60

Tasks starting between 30-60 = CALCULATETABLE('tasks',filter('tasks',Tasks[Task Finish Date]>TODAY()+30),FILTER('tasks','Tasks'[Task Finish Date]<TODAY()+60))

and this returns the correct results.  Not sure why this same expression is not working for the Tasks Complete or Overdue?

1 ACCEPTED SOLUTION

Turns out it was a lot simpler than I was making it initially.  It was just a matter of me getting the syntax right:

Tasks Overdue or Closed =

FILTER('tasks',

'Tasks'[Task Finish Date]<TODAY()

||

'Tasks'[Task Percent Completed]=100

)

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Does this work?

Tasks Closed or Overdue = CALCULATETABLE('Tasks',FILTER('tasks',Tasks[Task Percent Completed]=100||'Tasks'[Task Finish Date]<TODAY()))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur ,

 

No, it  generates the error "A function 'Filter' has been used in a true/false expression that is used as a table filter expression.  This is not allowed."

I was able to work around the Filter function error by using the following DAX:

Tasks Closed or Overdue =
VAR Tasksoverdue =
FILTER('Tasks',Tasks[Task Finish Date]<TODAY())
return

CALCULATE('tasks','Tasks'[Task Percent Completed]=100)
||
Tasksoverdue
 
The problem is this returns the error "The expression refers to multiple columns.  Multiple columns cannot be converted to a scalar value".

Hi,

If you are OK with returning an actual Table/matrix visual on the canvas (instead of a virtual table), then I can help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@CLS  i had similar requirement and I ended up creating a view in the database itself after multiple failed attempts using SUMMERIZETABLE/CALCUALTE/SUMMRIZE.

Turns out it was a lot simpler than I was making it initially.  It was just a matter of me getting the syntax right:

Tasks Overdue or Closed =

FILTER('tasks',

'Tasks'[Task Finish Date]<TODAY()

||

'Tasks'[Task Percent Completed]=100

)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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