Forum Discussion
Anonymous
6 years agoNot applicable
Logical Count Function.
I am trying to calclulate the following: When a certain date is blank, count a related date.
IF(IsBlank(A Date)
,COUNT(B Date)
,Blank()
*This is a direct query with SQL
Any tips on how to do this? I am new to PowerBi logic.
14 Replies
- speedrampsSuper User
Hi TSP
Please consider this solution and leave kudos
COUNTBLANK(<columnname>)
this will count the number of rows with a blank value in the column.
Note it will return 0 if there are rows but no blanks,
but will retrun blank if the table has no rows at all.- AnonymousNot applicable
Thanks for the suggestion, but I am wanting to count "B" Date if "A" date is blank.
- speedrampsSuper User
Hi again TSP
Please consider this solution and leave kudos
Mycounter =
CALCULATE(COUNT('MyTable'[MyColumnB),
FILTER('MyTable'[MyColumnA)=BLANK())
)The filter just selects the rows with ColumnA = blankthen the count counts the remaining rows with a populated ColumnB.Any rows with a blank ColumnB will not be counted.