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
lalithakiran
Regular Visitor

Count the number of incident, which is less than *

Hi,

I tried to calculate and make tabular format, which total number of records less than 5, less than 3, less than 2 and less than 1.

Capture.PNGi could not figure it out how can i achive this as i am totaly new this power BI

1 ACCEPTED SOLUTION

CountLT5GT4 = COUNTX(FILTER(Table, Table[Column]<5 && Table[Column]>4),[Column])

No problem, my pleasure! 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

You would create a couple measures in your data model. Data model tab on the left, Modeling, New Measure. The general formula would be:

 

CountLessThan5 = COUNTX(FILTER(Table, Table[Column]<5),[Column])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler: Thanks you. Its realy helps me your solution to my earlier posts also. Additionatly, i require to count, which is less than 5 and grater than 4 (like in between). how to define formula for that.

CountLT5GT4 = COUNTX(FILTER(Table, Table[Column]<5 && Table[Column]>4),[Column])

No problem, my pleasure! 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you.. I realized that, my formula was wrong

i am getting result count is zero, if i were use && opeator. i am getting proper result when i use || operator for first condition (COUNTX(FILTER(Feedback,Feedback[Avg]>5 || Feedback[Avg]<= 4),Feedback[Avg]) ).

 

 when i use second condition for different measure field

 COUNTX(FILTER(Feedback,(Feedback[Avg]>4 || Feedback[Avg]<=3)),Feedback[Avg])

this returning unexpected count (count is 8). For this condition the result should be two. But i am getting count 8, which are blank fields are also behind.

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.