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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I am working in PowerBI. I am looking for a specific filtering and counting of information from an already transformed query. The raw data of what I am asking for can be seen in the Table Below. I want to only count and show all "US" AND "5", as well as count and show all MX "4". I want to leave out US "4" and leave out MX "5", in the count scenario.
| Country | Level |
US | 4 |
| US | 5 |
| US | 4 |
| MX | 5 |
| MX | 4 |
| US | 5 |
Solved! Go to Solution.
Filtered Count =
CALCULATE(
COUNTROWS('YourTableName'),
FILTER(
'YourTableName',
('YourTableName'[Country] = "US" && 'YourTableName'[Level] = 5)
|| ('YourTableName'[Country] = "MX" && 'YourTableName'[Level] = 4)
)
)
Replace with Table Name as per yours
Hi @JacobMich,
I hope you had a chance to review the solution shared by @danextian @ryan_mayu @Nayan_Dholakia . If it addressed your question, please consider accepting it as the solution — it helps others find answers more quickly.
If you're still facing the issue, feel free to reply, and we’ll be happy to assist further.
Thank you.
Hi @JacobMich
I'm not sure what you expected results are but try these measures:
US and 5 =
COUNTROWS ( FILTER ( 'Table', 'Table'[Country] = "US" && 'Table'[Level] = 5 ) )
MX and 4 =
COUNTROWS ( FILTER ( 'Table', 'Table'[Country] = "MX" && 'Table'[Level] = 4 ) )
Both =
COUNTROWS (
FILTER (
'Table',
( 'Table'[Country] = "US"
&& 'Table'[Level] = 5 )
|| ( 'Table'[Country] = "MX"
&& 'Table'[Level] = 4 )
)
)
how do you want to display the output? in the card or in a table?
You can try @Nayan_Dholakia 's solution. That will work
if you want to display in a card, add the meausre to the card
if you want to display in a tabel, try to update the measure
Proud to be a Super User!
Filtered Count =
CALCULATE(
COUNTROWS('YourTableName'),
FILTER(
'YourTableName',
('YourTableName'[Country] = "US" && 'YourTableName'[Level] = 5)
|| ('YourTableName'[Country] = "MX" && 'YourTableName'[Level] = 4)
)
)
Replace with Table Name as per yours
Where do I place the above code and syntax?
Create a Dax - New measure
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 51 | |
| 46 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 136 | |
| 110 | |
| 50 | |
| 32 | |
| 29 |