Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ngiam
Helper I
Helper I

How to perform COUNTIF on Measurement?

Hi,

 

How do I perform a countif using measurement?

 

I have a measurement created to categorize Strength, Weakness, Average.

 

Strength =
SWITCH( TRUE,
(((Sheet[Superior Score]+Sheet[Team Member Score])/2)>3.00), "Strength",
(((Sheet[Superior Score]+Sheet[Team Member Score])/2)<2.20), "Weakness",
((Sheet[Superior Score]+Sheet[Team Member Score])/2)<2.01, "Weakness",
"Average"
)
 
After that i would like to COUNT the number of strength, weakness and average. Can't seems to link anything to the earlier mentioned measurement.
 
Is there a way to do this?
 
Btw, how to post the pbix file? can't seems to find the right place to upload
1 ACCEPTED SOLUTION

@ngiam , sorry my mistake

Strength =

countrows(filter(Sheet,Sheet[Strength] = "Strength"))

 

Weakness=

countrows(filter(Sheet,Sheet[Strength] = "Weakness"))

 

Average=

countrows(filter(Sheet,Sheet[Strength] = "Average"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
ngiam
Helper I
Helper I

Hi @amitchandak ,

 

Thank you for your reply.

I encoutered the following issue :

 

Too few arguments were passed to the FILTER function. The minimum argument count for the function is 2.

 

Just manage to upload my file here : 

https://drive.google.com/drive/folders/12F-Kgb_vvUm13qEdCqOAA_8MJT2IQg2O?usp=sharing

@ngiam , sorry my mistake

Strength =

countrows(filter(Sheet,Sheet[Strength] = "Strength"))

 

Weakness=

countrows(filter(Sheet,Sheet[Strength] = "Weakness"))

 

Average=

countrows(filter(Sheet,Sheet[Strength] = "Average"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thank you! This works!

amitchandak
Super User
Super User

@ngiam , if above is a calculated column, then you can create measure like

Strength =

countrows(filter(Sheet[Strength] = "Strength"))

 

Weakness=

countrows(filter(Sheet[Strength] = "Weakness"))

 

Average=

countrows(filter(Sheet[Strength] = "Average"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.