The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Number of open tasks with special filter =
CALCULATE('Key figures task'[number of open tasks],OR(CONTAINSSTRING('task'[task name],"Inbox*Input"),CONTAINSSTRING('task'[task name],"Inbox*Output")))
Hello, I have a PBI file with a direct query connection to a cube and therefore no tables. There are already some measures. Now I have created this measure (see above) because the PBI standard filtering only ever allows exclusively AND or exclusively OR operators. But here I want to say, filter contains "Inbox" "..." "Input" as AND
OR
contains "Inbox" "..." "Output" as AND. So a mixture of AND & OR.
The overall output in the slicer is also correct. But a drill-through must also be granted, which then displays a table as a visual and here the rows have not been filtered as desired, but rather show all tasks bluntly. So only the Silcer output is correct. Example: After this filtering there should be 24 tasks. The slicer also displays these 24 correctly. In a drill-trhough you see 270 tasks.
What do I have to do to make this work properly? Thanks!
Hi, @TheScrub
You should use the Filter function or other related logic functions to combine the AND and OR conditions. Since I don't have your example data, the following DAX expression is just an idea for me:
Number of open tasks with special filter =
CALCULATE(
[Key figures task[number of open tasks]],
FILTER(
ALL(task),
(CONTAINSSTRING(task[name], "Inbox*Input") && CONTAINSSTRING(task[task name], "Inbox*Output"))
||
(CONTAINSSTRING(task[name], "Inbox") && CONTAINSSTRING(task[task name], "Output"))
)
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
"inbox and output or inbox and input" can be simplified as " inbox and either input or output ".
DAX does not have a concept of wildcards ( "*" ) but that isn't really necessary here unless you insist on the order of appearance.