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 All,
I have a SP connected to PBI report and there is coulmn that have certain values (1,2,3,4)
i would like to know how many rows that have value of "1" and "2"
how to do that ?
Solved! Go to Solution.
Hi @MostafaGamal ,
Please try below steps:
1. below is my test table
Table:
2. create a measure with below dax formula
Measure =
VAR tmp =
FILTER ( ALL ( 'Table' ), 'Table'[Rating] IN { 1, 2 } )
RETURN
COUNTROWS ( tmp )
3. add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MostafaGamal ,
Please try below steps:
1. below is my test table
Table:
2. create a measure with below dax formula
Measure =
VAR tmp =
FILTER ( ALL ( 'Table' ), 'Table'[Rating] IN { 1, 2 } )
RETURN
COUNTROWS ( tmp )
3. add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Try this but put the column name in the measure:
measure = calculate(count(columnName),columnName =1 || columnName = 2)
If I answered your question, please mark my post as solution, Appreciate your Kudos!
Proud to be a Super User! | |
i use the formula but it gives me an error
@MostafaGamal
The below might help you
https://community.powerbi.com/t5/Desktop/CountIf-in-PB/td-p/1317714
Can you please explain more, i dont have much experince on PBI
@MostafaGamal Please share the sample data or pbix file (after removing all the sensitive information). With the desired output to help you better.
there is a snapshot for the table i use its called "answers"
i want to know how many rows of column called "Rating" that have the value of "2" and "1"
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 41 | |
| 22 | |
| 17 |
| User | Count |
|---|---|
| 186 | |
| 116 | |
| 95 | |
| 64 | |
| 45 |