Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am struggling to get a result for COUNTROWS based on multiple critera.
From the table I am trying to filter all Males with a grade of either C,D or E and to give me the count of rows.
This is what I have:
CALCULATE(COUNTROWS(Tbl_ORG001),Tbl_ORG001[HCD_Gender] = "M",Tbl_ORG001[HCD_Band] = "C",Tbl_ORG001[HCD_Band] = "D",Tbl_ORG001[HCD_Band] = "E")
This does not come back with an error, but just displays nothing in the column.
Can anyone help?
Solved! Go to Solution.
MaleCDEcount = CALCULATE(
COUNTROWS(Grades),
FILTER(Grades,Grades[Gender]="M"),
FILTER(Grades,
Grades[Grade]="c" || Grades[Grade]="d" || Grades[Grade]="e")
)
My table is named 'Grades' - you will want to change this code to your table name.
Another potential implementation could be:
CALCULATE(
COUNTA(Tbl_ORG001), Tbl_ORG001[HCD_Gender] = "M",
OR(Tbl_ORG001[HCD_Band] = "C",
OR(Tbl_ORG001[HCD_Band] = "D", Tbl_ORG001[HCD_Band] = "E",)
)
)This applies a filter of Male and considers all rows that have a grade of either C, D or E and returns a count of rows that satisfy that filter.
MaleCDEcount = CALCULATE(
COUNTROWS(Grades),
FILTER(Grades,Grades[Gender]="M"),
FILTER(Grades,
Grades[Grade]="c" || Grades[Grade]="d" || Grades[Grade]="e")
)
My table is named 'Grades' - you will want to change this code to your table name.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |