I have a table like below in power BI with two columns Category and subcategory. I m trying to get the count of subcategory="S2" for each category into a calculated column (like in S2_count).
Category Subcategory S2_count
A S1 1
A S2 1
A S1 1
B S1 2
B S3 2
B S2 2
B S2 2
C S2 2
C S3 2
C S2 2
Is there a way using the DAX to get this ? I tried the below formula but no clue how to apply both filter and group by
s2_count =
CALCULATE(
COUNT(Test01[subcategory]),
GROUPBY(Test01,Test01[subcategory]))
