Forum Discussion
Anisul_Haque
Apr 26, 2024Copper Contributor
Trying to count unique items from a data set with multiple conditions
Hi, I just joined this community and looking for some help! I have a set of data from which I am trying to count unique items under certain categories. For example, there are multiple categories ...
Anisul_Haque
Apr 26, 2024Copper Contributor
Hi Hans Vogelaar,
Thanks for the quick reply, really appreciate it. I will definitely try this, can there be a formula or function to extract the same information, just curious!
Anisul Haque
Thanks for the quick reply, really appreciate it. I will definitely try this, can there be a formula or function to extract the same information, just curious!
Anisul Haque
Patrick2788
Apr 26, 2024Silver Contributor
With a formula and the data being tabled:
=LET(
category, SORT(UNIQUE(Table1[Category])),
UniqueProducts, LAMBDA(acc, v,
LET(
filtered, FILTER(Table1[Product], Table1[Category] = v),
distinct, ROWS(UNIQUE(filtered)),
VSTACK(acc, HSTACK(v, distinct))
)
),
REDUCE({"Category", "Count"}, category, UniqueProducts)
)- Anisul_HaqueApr 26, 2024Copper ContributorThank you, Patrick, really appreciate it.
- Patrick2788Apr 26, 2024Silver ContributorYou're welcome!