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
UsePowerBI
Post Prodigy
Post Prodigy

Count rows if Col1 AND Col2 are blank

Hello

 

I have this formula:

 

IF(SELECTEDVALUE(CurrentTable[Col1])="1",CALCULATE(COUNT(AnotherTable[Col2]),FILTER(AnotherTable,AnotherTable[Col3]=SELECTEDVALUE(CurrentTable[Col1])),AnotherTable[Col2]<>"")
 
How can I cound the rows that have empty-or-blank in all AnotherTable[Col2], AnotherTable[Col5], AnotherTable[Col7] while the other critera still apply, i.e. AnotherTable[Col3]=SELECTEDVALUE(CurrentTable[Col1]) ?
 
Thanks! 
4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @UsePowerBI 

 

Could you please show us some sample data and expected result with One Drive for business? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @UsePowerBI 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @UsePowerBI 

 

Based on your description, I created data to reproduce your scenario.

CurrentTable:

a1.PNG

 

AnotherTable:

a2.PNG

 

You may create a measure as below.

Result = 
var _col1 = SELECTEDVALUE(CurrentTable[Col1])
return
IF(
    _col1 = "1",
    CALCULATE(
        COUNT(AnotherTable[Col2]),
        FILTER(
            ALL(AnotherTable),
            AND(
            AnotherTable[Col3]=_col1,
            AnotherTable[Col2]=BLANK()
            )
        )
    )
)

 

Result:

a3.PNG

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please explain the issue again and provide some sample data and expected outcome.

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.