Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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?
Solved! Go to 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
)
Hi,
Does this work?
Tasks Closed or Overdue = CALCULATETABLE('Tasks',FILTER('tasks',Tasks[Task Percent Completed]=100||'Tasks'[Task Finish Date]<TODAY()))
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:
Hi,
If you are OK with returning an actual Table/matrix visual on the canvas (instead of a virtual table), then I can help.
@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
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |