Forum Discussion

TestTest17891's avatar
TestTest17891
Icon for Advocate I rankAdvocate I
2 years ago
Solved

Create a DAX expression to count the non-blank rows in a table based on a specific condition

How can I formulate a DAX expression that filters a table based on conditions in two different columns and then counts the remaining rows in Power BI ?

measure = CALCULATE (
COUNTROWS( df )
,df[column1] IN { "col1", "col2", "col2" }
&&df[column2] <> 0
)

  • Try the following : 

     

    measure =  CALCULATE (
               COUNTROWS( df )
                      ,df[column1] IN { "col1", "col2", "col2" } 
                     && VALUE(df[column2]) <> 0
            )

1 Reply

  • Try the following : 

     

    measure =  CALCULATE (
               COUNTROWS( df )
                      ,df[column1] IN { "col1", "col2", "col2" } 
                     && VALUE(df[column2]) <> 0
            )