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
hI bhanu_gautam sroy_16 danextian - Thanks for all of your help.
Can you please help with the following DAX:
I want to Count the values of food in Irish and American if 2 values are selected in the slicer (America and Irish), can you please help with this?
HI Lauraeire_81
Please give this a try and let me know if it meets your requirements.
IrishandAmerican =
VAR selectedValues = VALUES('Sheet1'[Column1])
RETURN
IF (
COUNTROWS(selectedValues) = 2
&& "Irish" IN selectedValues
&& "American" IN selectedValues,
CALCULATE (
DISTINCTCOUNT('Sheet1'[Column2]),
'Sheet1'[Column1] IN {"Irish", "American"}
),
0
)