Forum Discussion

TheLazerBean's avatar
TheLazerBean
New Member
5 years ago
Solved

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...
  • d_gosbell's avatar
    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...