Forum Discussion

SelflearningBi's avatar
SelflearningBi
Helper III
3 years ago
Solved

COUNT NOT BLANK

MODEL NAMEON TIME?
AYES
B 
CNO
DNO


I would like to see how many % on time is YES.   The calcuation should look like this 1/3=33%
I dont want to include the blank B in my total. 

How to write DAX measure ? 

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Yes percentage measure: =
    VAR _yes =
        COUNTROWS ( FILTER ( Data, Data[ON TIME?] = "YES" ) )
    VAR _allcountwithoutblank =
        COUNTROWS ( FILTER ( Data, Data[ON TIME?] <> BLANK () ) )
    RETURN
        DIVIDE ( _yes, _allcountwithoutblank )
    

1 Reply

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Yes percentage measure: =
    VAR _yes =
        COUNTROWS ( FILTER ( Data, Data[ON TIME?] = "YES" ) )
    VAR _allcountwithoutblank =
        COUNTROWS ( FILTER ( Data, Data[ON TIME?] <> BLANK () ) )
    RETURN
        DIVIDE ( _yes, _allcountwithoutblank )