Forum Discussion

mani3593's avatar
mani3593
Frequent Visitor
8 years ago
Solved

Measure to count the categories based on values

I have a category and subcategory  which has combination +ve , -ve and 0 values  .  I would like to create a mesure to calculate the number of categoies ( rows count)  which has a positive , negative and zero values . I have created the following for measures to calculate that but it returns the subcategories count rather than a categories count. Please refer the attached images. Anyone please suggest me to find out.  

      +ve CategoriesCount = CALCULATE(COUNT('Sheet2 (2)'[Category]),'Sheet2 (2)'[Values] >0)

       -ve CategoriesCount = CALCULATE(COUNT('Sheet2 (2)'[Category]),'Sheet2 (2)'[Values] <0)

       zero CategoriesCount = CALCULATE(COUNT('Sheet2 (2)'[Category]),'Sheet2 (2)'[Values] =0)