Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Simple DAX Calculation for Counting a Column with Specific Text - Driving Me Mad

Hi All

 

I have a Project Status column where possible values are:

 

 

I was creating a  measure  which is supposed to count all blocked items

 

CountBlocked = CALCULATE ( COUNTROWS ( tbl_POAP_master); tbl_POAP_master[Status] = " Blocked " )
 
I just cant get it to work. BTW Countrows is ok
 
Appreciate any assistance on what Im doing wrong?
 
Jimmy
 
  • Anonymous You have a semicolon instead of a comma after COUNTROWS ( tbl_POAP_master); 

     

    CountBlocked = CALCULATE ( COUNTROWS ( tbl_POAP_master), tbl_POAP_master[Status] = " Blocked " )

  • Anonymous do this:

     

    CountBlocked = CALCULATE ( COUNTROWS ( tbl_POAP_master), tbl_POAP_master[Status] = " Blocked " ) + 0

5 Replies

  • Anonymous do this:

     

    CountBlocked = CALCULATE ( COUNTROWS ( tbl_POAP_master), tbl_POAP_master[Status] = " Blocked " ) + 0
    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks again parry2k   Im a virgin user of PBI but amazed at whats Ive been able to achieve with the help of this board; people like you and perserveriance 

       

  • Anonymous You have a semicolon instead of a comma after COUNTROWS ( tbl_POAP_master); 

     

    CountBlocked = CALCULATE ( COUNTROWS ( tbl_POAP_master), tbl_POAP_master[Status] = " Blocked " )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks rtran   That was just perfect. Question.

       

      If I have no count as there is nothing blocked; can I just add an if statement , where if there are no values just displaye the false value of 0 ?   As it currently shows as blank.