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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
atharvaunde59
Frequent Visitor

COUNTIFS() with comparison

Hello everyone,

am extremly sorry for posting for this problem again though there are lot of similar topic threads are there.

I have a table with multiple columns

I want to use countifs() in it but as powerbi is not having support for it 

in excel i was using result=countif(<range>,"<20") to get count of rows who had values less than 20.

How it can be acheived in DAX?

2 ACCEPTED SOLUTIONS

Hi @atharvaunde59 

 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table', 'Table'[Range] < 20))

 

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Range] < 20)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Try this measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Range] < 20)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks  a lot,

got it solved. Can u help me regarding my issues in plotting spider chart. May I DM u?

Hi,

You are welcome.  If my reply helped, please mark it as Answer.  If you second question is related to this, post it here, else please start a new thread.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I have opened a thread but rather am not getting proper ans or am not able to get them,

It will be great if u look at this 

https://community.powerbi.com/t5/Desktop/Creating-custom-Radar-chart/m-p/884245#M423755

Hi @atharvaunde59 

 

 

Measure = CALCULATE(COUNTROWS('Table'),FILTER('Table', 'Table'[Range] < 20))

 

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


I tried that measure but its is giving me wrong output.

I edited it as follwing 

Measure = CALCULATE(COUNTROWS('sppu_se_comp sem_1_analysis'),FILTER('sppu_se_comp sem_1_analysis', 'sppu_se_comp sem_1_analysis'[COA_TH] < 20))
 
 
where sppu_comp sem_1_analysis is my table name and COA_TH is column name from which I need to count no of students who's marks are less than 20.
 
To verify it I applied filter on excel data and the actual answer is 8 but when i add that measure to card it shows count as 1

Hi @atharvaunde59 ,

 

could you share some screenshots?

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


So sorry, I mistakenly attached wrong table in query to analyze.

Got it solved! 

Thanks a lot for help!!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.