Forum Discussion

Namdu_PAU's avatar
Namdu_PAU
Frequent Visitor
1 year ago
Solved

Count Total Rows while Ignoring Column Filters

Hey all,

 

Intermediate user to PBI here asking for help around a calculation.

I am currently trying to summarise training results for the business and have 3 connected tables:

 

 

My task is to (for every trainee) calculate the % completed for each training group.

My approach to this was to create a table and use SUMMARIZE.

However, I am having trouble with the calculation for the total # column.

 

 

I would like the "Total # Courses" to display the total number of available courses for that training group.

For example, the first 3 rows, Total # Courses should be: 31, 43 and 11 respectively.

However instead it is simply showing me a filtered count based on User Name.

 

It feels like such a simple DAX code but I simply cannot work it out.

 

Any help is sincerely appreciated.

 

Regards,

Namdu

  • I have managed to solve it myself!

     

    The DAX Code is: 

    "Total # Courses", CALCULATE(COUNTROWS(Curriculum),ALL(Curriculum),VALUES(Curriculum[Training Group]))
     

    It is now correctly counting the total number of courses within the group. My problem was using "ALLSELECTED" or "ALLEXCEPT", these filters kept the row context filters. I had to first use the ALL function, and then specify the values.

6 Replies