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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
StuartSmith
Power Participant
Power Participant

Check for Blank Rows after certain number of rows. EXAMPLE FILE INCLUDED

I am trying to figure out how to check if there are any blank rows after a certain number of rows, but cant figure out the correct "IF" statement

 

StuartSmith_0-1706725368277.png

Can someone point me in the right direction.

 

Exampe File: Check-for-Blank-Rows.pbix 

Thanks in advance.

3 REPLIES 3
edhans
Super User
Super User

I think you want something like this:

Test =
IF (
    numberofdaysabsent > numberofdaysrequiredby
        && CALCULATE (
            COUNTBLANK ( 'Absence Master list'[Backfill] ),
            'Absence master list'[absencedate] > lastrequiredbydate
        ) > 0,
    "Blank",
    "No Blanks"
)

 

If the absent days > days required and there are blanks, then return "Blank" otherwise "No Blanks" 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Thanks.  I tried your code, but if any of the records has a "Blank" row, insead of displaing "Blank", it displays 2 rows, one saying "Blank" & one saying "No Blanks" and I cant figure out why. 

StuartSmith_0-1706739843858.png

Thanks in advance.

It is because CALCULATE is invoking context transition and it is effectively iterating through the rows.

Test =
IF (
    numberofdaysabsent > numberofdaysrequiredby
        && CALCULATE (
            COUNTBLANK ( 'Absence Master list'[Backfill] ),
            'Absence master list'[absencedate] > lastrequiredbydate,
            REMOVEFILTERS (
                'Absence Master list'[Backfill],
                'Absence Master list'[absencedate]
            )
        ) > 0,
    "Blank",
    "No Blanks"
)

 

That will remove the filters for the backfill and absencedate fields and do the COUNTBLANK() on both at once. That may or may not be right and you will need to tweak those based on the fields in your visual. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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