Forum Discussion
TheLazerBean
5 years agoNew Member
Create custom column to test if 'status' column has the value 'complete' for all records w/ same ID
I have two tables with a one-to-many relationship as follows: My goal is to create a column in the second table (the table with many/duplicate wr_id values) that will indicate whether th...
- 5 years ago
So you could this with a column expression like the following
All Complete =var _wr_id = [wr_id]var wr_id_rows = COUNTROWS(filter('Table','Table'[wr_id] = _wr_id))var complete_rows = COUNTROWS(filter('Table','Table'[wr_id] = _wr_id && [status] = "Complete"))return if (wr_id_rows = complete_rows, "yes","no")But I would have thought that a column like this would have made more sense on the one side of the relationship...
d_gosbell
Super User
5 years agoSo you could this with a column expression like the following
All Complete =
var _wr_id = [wr_id]
var wr_id_rows = COUNTROWS(filter('Table','Table'[wr_id] = _wr_id))
var complete_rows = COUNTROWS(filter('Table','Table'[wr_id] = _wr_id && [status] = "Complete"))
return if (wr_id_rows = complete_rows, "yes","no")
But I would have thought that a column like this would have made more sense on the one side of the relationship...
- TheLazerBean5 years agoNew Member
Thank you so much! Works perfectly.
And you are right, i altered the code above to work in the one-table.
thanks again,
Ben