Forum Discussion
and_rogynous
Nov 29, 2022Copper Contributor
Counting Unique Values with Multiple Criteria
I am using the following formula to count the amount of unique freight carriers I use each day at work: =SUM(--LEN(UNIQUE(FILTER(Orders[Carrier],Orders[Shipped]=Dates[@[11/22]],"")))>0)) Orders[Car...
PeterBartholomew1
Nov 29, 2022Silver Contributor
Since you are using FILTER, you may have LAMBDA. AND can be made to operate pairwise by placing it with the MAP helper function
= UNIQUE(
FILTER(Orders[Carrier],
MAP(Orders[Shipped],
LAMBDA(shippingDate,
AND(shippingDate>=start, shippingDate<=end)
)
)
)
)
Naming the Lambda functions can also be useful
= UNIQUE(
FILTER(Orders[Carrier],
MAP(Orders[Shipped], Betweenλ(start, end))
)
)
where
Betweenλ
= LAMBDA(start,end,
LAMBDA(shippingDate,
AND(shippingDate>=start,shippingDate<=end
)
)
- PeterBartholomew1Nov 29, 2022Silver Contributor
File