Forum Discussion
Count values in categories
- 1 year ago
Hi Lauraeire_81 ,As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,Chaithanya
Hello Lauraeire_81
Please try using these measures and see if it fulfils your requirement.
Count_American_Only =
CALCULATE (
DISTINCTCOUNT (FoodCategory[Food]),
FoodCategory[Food Category] = "American",
NOT (
FoodCategory[Food] IN
CALCULATETABLE (
VALUES (FoodCategory[Food]),
FoodCategory[Food Category] <> "American"
)
)
)
Count_American_and_Irish =
CALCULATE (
DISTINCTCOUNT (FoodCategory[Food]),
FoodCategory[Food] IN
CALCULATETABLE (
VALUES (FoodCategory[Food]),
FoodCategory[Food Category] = "American"
),
FoodCategory[Food] IN
CALCULATETABLE (
VALUES (FoodCategory[Food]),
FoodCategory[Food Category] = "Irish"
)
)
Count_Italian_Only =
CALCULATE (
DISTINCTCOUNT (FoodCategory[Food]),
FoodCategory[Food Category] = "Italian",
NOT (
FoodCategory[Food] IN
CALCULATETABLE (
VALUES (FoodCategory[Food]),
FoodCategory[Food Category] <> "Italian"
)
)
)
I hope the solution I provided helps! If it works for you and solves your issue, please feel free to mark it as a solution so it can assist others who may have the same problem.