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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
ERing
Post Partisan
Post Partisan

Is there any technical or practical difference between these two measures?

I have data structured like below and I need to return the number of records from my table that meet the following conditions:

1. 'Table_A'[Has_APP_Recording] = "Y"

2. 'Table_A'[Training_Complete] = "Y"

3. 'Table_A'[APP_Recording_Minutes] > 75


I have found that each of the measures below returns the same value. 

I'm wondering if there is any technical or practical difference in these measures?

What would happen if I had rows where Job_ID was missing? I would still want to count these records, but I'm assuming they would not get counted with Valid_Jobs_2 measure? Maybe Valid_Jobs_1 is better becuase it doesn't rely on a column to count?

 

Sample File 

Data Structure.png

Valid_Jobs_1 = 
COUNTROWS(
    FILTER(
        'Table_A',
        'Table_A'[Has_APP_Recording] = "Y"
        && 'Table_A'[Training_Complete] = "Y"
        && 'Table_A'[APP_Recording_Minutes] > 75
    )
)



Valid_Jobs_2 = 
COUNTX(
    FILTER(
        'Table_A',
        'Table_A'[Has_APP_Recording] = "Y"
        && 'Table_A'[Training_Complete] = "Y"
        && 'Table_A'[APP_Recording_Minutes] > 75
    ),
    'Table_A'[Count_Job_Id]
)


Table.png

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @ERing 

 

The first one is faster as it simply counts the rows. The second one iterates row by row before evaluating and counting non-blank values in a specific column (Count_Job_Id). This extra step introduces additional overhead, especially if the column is a calculated column or if the dataset is large. Therefore, COUNTROWS is generally more efficient when you only need to count the number of rows that meet certain conditions, while COUNTX should be used when you're specifically interested in counting valid (non-blank) entries of a particular column within that filtered set.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @ERing 

 

The first one is faster as it simply counts the rows. The second one iterates row by row before evaluating and counting non-blank values in a specific column (Count_Job_Id). This extra step introduces additional overhead, especially if the column is a calculated column or if the dataset is large. Therefore, COUNTROWS is generally more efficient when you only need to count the number of rows that meet certain conditions, while COUNTX should be used when you're specifically interested in counting valid (non-blank) entries of a particular column within that filtered set.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian This makes sense. Thank you for the explanation.

maruthisp
Super User
Super User

Hi @ERing ,

As per my knowledge, below is the differences which I can see:

If you want to count every matching record, even those with no Job ID or where Count_Job_Id is empty, go with Valid_Jobs_1.

If you only want to count records that also carry a valid Job ID (or any non-blank column), then Valid_Jobs_2 is the right choice.

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X



maruthisp
Super User
Super User

Hi ERing,
Both will return the same rsult as long every row in your filtered table has non blank values.

COUNTROWS - simple counts everyrow that passess filter expression
COUNTX - Iterated the same filtered set of rows, but for each row it evaluates table ID and only increments the count
For more info:
Use COUNTROWS instead of COUNT in DAX - DAX | Microsoft Learn
COUNTROWS vs COUNT DAX Functions in Power BI – Simple Example

COUNTROWS counts rows.
COUNTX counts non-blank values of the expression you pass - Job_ID column

Please let me know if you have further questions.

If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks! 

 

Best Regards, 

Maruthi 

LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/ 

X            -  Maruthi Siva Prasad - (@MaruthiSP) / X



Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors