Forum Discussion

Torudd-55's avatar
Torudd-55
Frequent Visitor
7 years ago
Solved

DAX EXCLUDE

Hi!

 

I want to exclude some of my rows when using a simple "COUNTROWS" function in Power BI desktop.

What i would like to get help with is a DAX formula for this that excludes specific rows that contains a ordernumber (this is a column in the table which i would like to count the number of rows in) that starts with a specific capital letter.

 

Any suggestions?

 

Thanks in advance!

 

/Johan

  • Anonymous's avatar
    Anonymous
    7 years ago
    Hope i understand correctly,
    COUNTROWS(FILTER(table;left(column;1)="T")

5 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Maybe you can post some samlple data? This would make it a lot easier to help you

    • Torudd-55's avatar
      Torudd-55
      Frequent Visitor

      Hi, see the picture below for an example of the data in the table. What i want is to count all of the rows whitin the table but exclude Order No_ that starts with tha capital letters R and M. In the picture these doesn't show, only the orders with a "T" as starting Letter. Hope this will help you help me. :)

       

      Thanks!

       

  • Anonymous's avatar
    Anonymous
    Not applicable
    Hi, does
    COUNTROWS(FILTER(table;column <>ordernr))


    Or

    COUNTROWS(
    FILTER(table;column <>ordernr||column<> ordernr)

    For excluding multiple orders.

    Gives you the desired outcome?
    • Torudd-55's avatar
      Torudd-55
      Frequent Visitor

      No, unfortunatly not. I posted some example data in another reply if that can help you aswell?

       

      Thanks for trying!

       

      /Johan

      • Anonymous's avatar
        Anonymous
        Not applicable
        Hope i understand correctly,
        COUNTROWS(FILTER(table;left(column;1)="T")