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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Help with DAX count blank rows not returning correct results

Hi, I have this dax function that counts blank rows based on condition. 

No MTM Scan (OnTime) = 
CALCULATE (
    COUNTROWS ( 'GMS Flat File' ),
    FILTER (
        'GMS Flat File',
        'GMS Flat File'[On_Time_Inb_Stretch_HTD] = 1
            && 'GMS Flat File'[Dest_Route_City_Nm] = "Wellington"
            && 
                'GMS Flat File'[MTM Entry Scan] = BLANK() || 'GMS Flat File'[MTM Exit Scan] = BLANK()))

The function returns incorrect result. It should be 11 rows as highlighted cells in screenshot below. The coutrows should be counting rows and not the cell.

qsmith83_0-1678142884194.png

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Anonymous 

so you get more than 11?

 

if so try like:

No MTM Scan (OnTime) = 

CALCULATE (

    COUNTROWS ( 'GMS Flat File' ),

    FILTER (

        'GMS Flat File',

        'GMS Flat File'[On_Time_Inb_Stretch_HTD] = 1

            && 'GMS Flat File'[Dest_Route_City_Nm] = "Wellington"

            && 

              (  'GMS Flat File'[MTM Entry Scan] = BLANK() || 'GMS Flat File'[MTM Exit Scan] = BLANK())))

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Anonymous 

so you get more than 11?

 

if so try like:

No MTM Scan (OnTime) = 

CALCULATE (

    COUNTROWS ( 'GMS Flat File' ),

    FILTER (

        'GMS Flat File',

        'GMS Flat File'[On_Time_Inb_Stretch_HTD] = 1

            && 'GMS Flat File'[Dest_Route_City_Nm] = "Wellington"

            && 

              (  'GMS Flat File'[MTM Entry Scan] = BLANK() || 'GMS Flat File'[MTM Exit Scan] = BLANK())))

Anonymous
Not applicable

@FreemanZ that worked. Many thanks for your help. Appreciate it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.