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.
I need to nest an AND and an OR clause in a FILTER, but I can't figure out how to do it.
Count of subcontracts in process = CALCULATE( COUNTROWS( subcontracts )
, FILTER( VALUES( subcontracts[subcontract_begin_date] )
, subcontracts[subcontract_begin_date] < max(CalendarAwardStartDate[date] )
)
, FILTER( values(subcontracts[execution_date])
,subcontracts[execution_date]>max(CalendarAwardStartDate[Date]) || (isblank(subcontracts[execution_date]) && subcontracts[status]="Fully executed")
)
)
When I try this, the subcontracts[status] field gives me a red squiggly underline. Is this a context issue or something else?
Thanks!
Solved! Go to Solution.
Hi @kman42 ,
Please refer to the following measure:
Count of subcontracts in process =
CALCULATE (
COUNTROWS ( subcontracts ),
FILTER (
VALUES ( subcontracts[subcontract_begin_date] ),
AND (
subcontracts[subcontract_begin_date] < MAX ( CalendarAwardStartDate[date] ),
OR (
subcontracts[execution_date] > MAX ( CalendarAwardStartDate[Date] ),
AND (
ISBLANK ( subcontracts[execution_date] ),
subcontracts[status] = "Fully executed"
)
)
)
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @kman42 ,
Please refer to the following measure:
Count of subcontracts in process =
CALCULATE (
COUNTROWS ( subcontracts ),
FILTER (
VALUES ( subcontracts[subcontract_begin_date] ),
AND (
subcontracts[subcontract_begin_date] < MAX ( CalendarAwardStartDate[date] ),
OR (
subcontracts[execution_date] > MAX ( CalendarAwardStartDate[Date] ),
AND (
ISBLANK ( subcontracts[execution_date] ),
subcontracts[status] = "Fully executed"
)
)
)
)
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
I think you might have just had a ) in the wrong spot, does this work for you?
Count of subcontracts in process =
CALCULATE (
COUNTROWS ( subcontracts ),
FILTER (
VALUES ( subcontracts[subcontract_begin_date] ),
subcontracts[subcontract_begin_date] < MAX ( CalendarAwardStartDate[date] )
),
FILTER (
VALUES ( subcontracts[execution_date] ),
( subcontracts[execution_date] > MAX ( CalendarAwardStartDate[Date] ) || ISBLANK ( subcontracts[execution_date] ) )
&& subcontracts[status] = "Fully executed"
)
)
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |