Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Excluding rows from Calculated table

Hi All,

 

I need to create a new table with DAX, excluding rows where STATE = STATE1 AND BRAND = BRAND1

 

Here is my dummy data: Table1

STORESTATEBRANDANSWER
STORE1STATE1BRAND11
STORE1STATE1BRAND20
STORE1STATE1BRAND31
STORE2STATE2BRAND11
STORE2STATE2BRAND21
STORE2STATE2BRAND30
STORE3STATE1BRAND10
STORE3STATE1BRAND21
STORE3STATE1BRAND30

 

I know I have to use CALCULATETABLE but I don't know how to filter out both conditions.

 

This is did I have so far:

Table2 = CALCULATETABLE( SUMMARIZE( Table1 , Table1[STORE], Table1[STATE], Table1[BRAND] ),

 ... )
 
Regards,
Rob
  • I loaded your data into a table 'Table1' 

    Then created a Table2 using the measure

    Table2 = FILTER ( Table1, NOT ( Table1[STATE] = "State1" && Table1[BRAND] = "Brand1" ) )

     Leaving a table with no row that is a State1 Brand1 row.  Was that what you were looking for?

     

     

3 Replies

  • I loaded your data into a table 'Table1' 

    Then created a Table2 using the measure

    Table2 = FILTER ( Table1, NOT ( Table1[STATE] = "State1" && Table1[BRAND] = "Brand1" ) )

     Leaving a table with no row that is a State1 Brand1 row.  Was that what you were looking for?

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      jdbuchanan71 thanks that 's exactly what I was looking for. I wasn't sure how to use the NOT function.

      Cheers

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hii RobinDeFal

     

    You want like this.....?

     

    Table2= CALCULATETABLE(Table1,FILTER(Table1,Table1[STATE]<>"STATE1"),Table1[BRAND]<>"BRAND1")