Forum Discussion

kyrpav's avatar
kyrpav
Helper V
6 years ago
Solved

COUNTIF in columns

I would like to do a Countif(RANGE;criteria)

 

where the range is one row but different columns. Columns also are not one next to the other. and the creteria is some text like:

 

COUNTIF(A3:K3;"R")

 

In this case excel would have skip all columns that could be numbers etc.

 

Is this possible with DAXs so i can create a new column in the table with a function to calculate each row?

 

  • Solved the problem with nested ifs so i could get for each column one value based on text. This was set to a variable.

     

    Also each column was calculated in a variable and then i just sum all variables

5 Replies

    • kyrpav's avatar
      kyrpav
      Helper V

      i do not think it is this. If you have a table :

       

      col1col2col3col4
      RGBR

       

      What i want is to by a function that passes all columns to count. 

      So by CountIF(A2:D2;"R") = 2

      and like this then i can count for each case seperately and sum up.

  • Icey's avatar
    Icey
    Community Support

    Hi kyrpav ,

     

    Is this problem solved?

     

     

    Best Regards,

    Icey

    • kyrpav's avatar
      kyrpav
      Helper V

      Solved the problem with nested ifs so i could get for each column one value based on text. This was set to a variable.

       

      Also each column was calculated in a variable and then i just sum all variables