Forum Discussion

mnarveson's avatar
mnarveson
Regular Visitor
7 years ago
Solved

Filter by status

I am very new to all of this BI material, but I love it. I am working with some survey data and trying to clean it up in Power Query before I use it. I have the relationships linked by respid on 4 different response tables to a response control. On the response control table I have status and want to filter out only those that were completed. It filters on the response control table but leaves the records on the other 4 tables. What am I doing wrong here?Before filtered by completeBefore filtered by completeAfter filtered by completeAfter filtered by complete

  • mnarveson,

     

    You may use code below to add a custom column to those 4 tables.

    let
        r = _
    in Table.MatchesAnyRows(
            response_control,
            each [respid] = r[respid]
            and [status] = "complete"
            )

2 Replies

  • Relationships in the model don't affect anything in the query editor.

     

    The process is roughly like this:

     

    Connect to Data --> Process Data in Query Editor --> Load Data to Model --> Create Relationships and Refine Model

     

    The arrows only go in one direction.

     

     

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    mnarveson,

     

    You may use code below to add a custom column to those 4 tables.

    let
        r = _
    in Table.MatchesAnyRows(
            response_control,
            each [respid] = r[respid]
            and [status] = "complete"
            )