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
Aimeeclaird
Helper IV
Helper IV

Count Blanks with 2 conditions/filters

I wonder if the below is possible...

 

I have a data set like this:

 

OwnerTest ResultTest request dateTest result date
SallyYes25/06/202027/06/2020
SallyYes15/06/202020/06/2020
DaveNo10/06/2020 
DaveNot Applicable  
SallyNot Applicable  

 

I am creating a report that monitors the number of blanks fields to ensure data is being entered. 

 

If the test is not applicable, I don't want to count the blanks as they are not needed. However if the Test Result is Yes or No, there should be a date for the Request and the Result. 

 

What would be the correct way to show this in a matrix as a count of the blanks? E.g. I'd like my matrix to look like...

 

NameBlank Test Request DateBlank Test Return Date
Sally00
Dave01
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Aimeeclaird 

Please try this

blank test request date = 
CALCULATE(COUNTBLANK('Table'[Test request date]),FILTER('Table','Table'[test result]="Yes"||'Table'[test result]="No"))+0

blank test result date = 
CALCULATE(COUNTBLANK('Table'[Test result date]),FILTER('Table','Table'[test result]="Yes"||'Table'[test result]="No"))+0

1.PNG





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
nvprasad
Solution Sage
Solution Sage

Hi,

 

Can you try the below measure for counting test result blanks? The same needs to be created for other columns then use them.

 

BlankTestResultCheck =
CALCULATE (
COUNTROWS ( 'Table' ),
'Table'[Test Result] = "Yes"
|| 'Table'[Test Result] = "NO",
'Table'[Test result date] = BLANK ()
)

Blankrowscount.PNG

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

ryan_mayu
Super User
Super User

@Aimeeclaird 

Please try this

blank test request date = 
CALCULATE(COUNTBLANK('Table'[Test request date]),FILTER('Table','Table'[test result]="Yes"||'Table'[test result]="No"))+0

blank test result date = 
CALCULATE(COUNTBLANK('Table'[Test result date]),FILTER('Table','Table'[test result]="Yes"||'Table'[test result]="No"))+0

1.PNG





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

Proud to be a Super User!




@ryan_mayu 

That's brilliant, thanks for your reply. 

 

For my own understanding can you tell me if '||' is what is needed to apply 2 filters? I had previously tried to add to filters (similar formula to your solution) but got a dax error in the measure. 

@Aimeeclaird 

 

|| means OR, that will only count staus is Yes or No and will not count the rows with Not applicable status.

Please let me know the error message.





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

Proud to be a Super User!




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.