Forum Discussion

poweruser55's avatar
poweruser55
Helper IV
4 years ago
Solved

Count not blanks

I have three statements that need to be added together. The first is OLI = Booked or Lost and Winning Vendor is Blank. The second is OLI = Active and winning vendor is not blank. The third is OLI = Lost and winning vendor = "S". I believe the forumla is correcr exceot for when it comes to the second statement counting not blanks. 

  • Hi, poweruser55 

     

    Has your problem been solved? I see that you have not responded since then.

     

    I checked your needs, you don't need to use countx or countblank functions in your code. You just need to use xxx=blank() or xxx<blank() in filter().

    Like this:

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

     

    Best Regards,

    Community Support Team _Janey

4 Replies

  • Hi poweruser55 

    What DAX error you have at the bottom of your dax expression? it is currently hidden in the screenshot. 

    Also what is the reason of using COUNAX() function?

    You are using COUNTAX with && condition without writing any condition there.

     

    You need a compariosn there.

    COUNTAX function requires 2 arguments. Something like this:

    COUNTAX(<table>,<expression>)

     

    See details here: https://docs.microsoft.com/en-us/dax/countax-function-dax

     

    • poweruser55's avatar
      poweruser55
      Helper IV

      Pragati11 I am trying to count everything that is not a blank. The error is that I dont have 2 arguments. I don't know what the other argument is supposed to be because I just need it to count everything in the column that is not blank.

      • Pragati11's avatar
        Pragati11
        Super User

        Hi poweruser55 ,

         

        You can club your condition in COUNTAX something like below from Line 6 & 7:

         

         

        
        COUNTAX ( FILTER ( '999_Funnel', [OLI.Status] = "Active" ), [C Winning Vendor] )
        

         

        I haven't checked the DAX. So try it.

         

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Community Support

    Hi, poweruser55 

     

    Has your problem been solved? I see that you have not responded since then.

     

    I checked your needs, you don't need to use countx or countblank functions in your code. You just need to use xxx=blank() or xxx<blank() in filter().

    Like this:

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

     

    Best Regards,

    Community Support Team _Janey