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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mbailey
Helper II
Helper II

COUNTAX not working properly

Hi,

I have a table with example data like this:

mbailey_0-1632328294773.png

In this example, it is filtered to one Unit/Partner Name, but the table contains many combinations of Units/Partners.

You can see in this example there are 6 total records with 1 record as a Priority of Emergency, and 4 have High.

I'm trying to create a measure that will count the total of each to be used in a Matrix  but, the results, for this example, show 6 for each:

mbailey_1-1632328826366.png

 

This is the formula I'm using: 

High Priority Count = COUNTAX(DMTA_Service_Report, DMTA_Service_Report[priority] = "High")
 
What am I doing wrong?
 
Thanks,
Mike

 

 

 

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@mbailey Try:

High Priority Count = COUNTROWS(FILTER(DMTA_Service_Report, DMTA_Service_Report[priority] = "High"))


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

AlexisOlson
Super User
Super User

COUNTAX returns the number of values that are non-blank and DMTA_Service_Report[priority] = "High" is either true or false for each row, not blank.

 

I think you want something more like

High Priority Count =
COUNTROWS (
    FILTER ( DMTA_Service_Report, DMTA_Service_Report[priority] = "High" )
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

COUNTAX returns the number of values that are non-blank and DMTA_Service_Report[priority] = "High" is either true or false for each row, not blank.

 

I think you want something more like

High Priority Count =
COUNTROWS (
    FILTER ( DMTA_Service_Report, DMTA_Service_Report[priority] = "High" )
)
Greg_Deckler
Super User
Super User

@mbailey Try:

High Priority Count = COUNTROWS(FILTER(DMTA_Service_Report, DMTA_Service_Report[priority] = "High"))


Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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