Forum Discussion
yogesh9ngp
6 years agoNew Member
Want to Delete and Retain Rows based on a Specific Value in the Column
Hello, I am working on a project and I am stuck on a problem. I want to delete Rows based on multiple conditions on more than one column. Following is the Example of the Data. Customer_Number ...
- 6 years ago
Hi yogesh9ngp ,
We can create a calculated table as below.
Table 2 = VAR k = ADDCOLUMNS ( 'Table', "A", VAR a = ADDCOLUMNS ( 'Table', "days", ABS ( DATEDIFF ( TODAY (), 'Table'[Date], DAY ) ) ) VAR days_ = ABS ( DATEDIFF ( TODAY (), 'Table'[Date], DAY ) ) VAR b = MINX ( FILTER ( a, 'Table'[Appointment_Status] = EARLIER ( 'Table'[Appointment_Status] ) ), [days] ) VAR s = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Appointment_Status] = "S" && 'Table'[Appointment_Status] = EARLIER ( 'Table'[Appointment_Status] ) ) ) RETURN IF ( days_ = b && 'Table'[Appointment_Status] <> "S", "NO- Appointment Scheduled", IF ( 'Table'[Appointment_Status] = "S", "Appointment Scheduled" ) ) ) RETURN FILTER ( k, [A] <> BLANK () )
Greg_Deckler
Community Champion
6 years agoCreate a custom column in Power Query that implements your logic and returns 1 if it does and 0 if it doesn't. Now, filter the table for just 0 values. Remove column.