Forum Discussion

mkgmoore's avatar
mkgmoore
Frequent Visitor
9 years ago
Solved

filter by comparing columns

I am somewhat new to Power BI but thoroughlky enjoy what visuals I have been able to create so far. I have been tasked with getting volunteers back into correct department. Over time they have been moved around and are now all over the place. 

 

Location        Current Department                 Assigned Department                Position Number             Person
Location 1                                                                       IT                                         543251                    Vacant
                                                                        Human Resources                               512874                    Vacant
                               IT                                       Financial Review                                 651832                   John Doe
                   Patient Accounts                              Oncology                                         214687                  Bill Edwards
                        Radiology                                    Radiology                                        358741                   Sally Fields
                  Human Resources                                Surgical                                         874123                 Mary Stratford
                  Financial Review                             Patient Accounts                                958412                    Harry Reid

 

Here is example of a table showing where volunteers have moved around over time. How could I do a lookupvalue or other relationship to be able to filter to show just rows for example of the department in the Current Department field is also located in the Assigned Department field and vice versa. This should enable us to move volunteers to the correct department they were originally assigned to?

I hope I explained this well enough.


  • mkgmoore wrote:

    I am somewhat new to Power BI but thoroughlky enjoy what visuals I have been able to create so far. I have been tasked with getting volunteers back into correct department. Over time they have been moved around and are now all over the place. 

     

    Location        Current Department                 Assigned Department                Position Number             Person
    Location 1                                                                       IT                                         543251                    Vacant
                                                                            Human Resources                               512874                    Vacant
                                   IT                                       Financial Review                                 651832                   John Doe
                       Patient Accounts                              Oncology                                         214687                  Bill Edwards
                            Radiology                                    Radiology                                        358741                   Sally Fields
                      Human Resources                                Surgical                                         874123                 Mary Stratford
                      Financial Review                             Patient Accounts                                958412                    Harry Reid

     

    Here is example of a table showing where volunteers have moved around over time. How could I do a lookupvalue or other relationship to be able to filter to show just rows for example of the department in the Current Department field is also located in the Assigned Department field and vice versa. This should enable us to move volunteers to the correct department they were originally assigned to?

    I hope I explained this well enough.


    mkgmoore

    Not sure if I've got your idea 100%, it seems you could use a DAX filter as

     

     

    filtered Table =
    FILTER (
        yourTable,
        yourTable[Assinged Department] = yourTable[Position Number]
    )

     

    By the way, I see blank location and no date fields in your table, I think it is not a good data structure, as it is not possbile to find the volunteers' department changing history, what is the datasource?

3 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    mkgmoore wrote:

    I am somewhat new to Power BI but thoroughlky enjoy what visuals I have been able to create so far. I have been tasked with getting volunteers back into correct department. Over time they have been moved around and are now all over the place. 

     

    Location        Current Department                 Assigned Department                Position Number             Person
    Location 1                                                                       IT                                         543251                    Vacant
                                                                            Human Resources                               512874                    Vacant
                                   IT                                       Financial Review                                 651832                   John Doe
                       Patient Accounts                              Oncology                                         214687                  Bill Edwards
                            Radiology                                    Radiology                                        358741                   Sally Fields
                      Human Resources                                Surgical                                         874123                 Mary Stratford
                      Financial Review                             Patient Accounts                                958412                    Harry Reid

     

    Here is example of a table showing where volunteers have moved around over time. How could I do a lookupvalue or other relationship to be able to filter to show just rows for example of the department in the Current Department field is also located in the Assigned Department field and vice versa. This should enable us to move volunteers to the correct department they were originally assigned to?

    I hope I explained this well enough.


    mkgmoore

    Not sure if I've got your idea 100%, it seems you could use a DAX filter as

     

     

    filtered Table =
    FILTER (
        yourTable,
        yourTable[Assinged Department] = yourTable[Position Number]
    )

     

    By the way, I see blank location and no date fields in your table, I think it is not a good data structure, as it is not possbile to find the volunteers' department changing history, what is the datasource?

    • mkgmoore's avatar
      mkgmoore
      Frequent Visitor

      Thanks for your suggestion. I do get an error though "The expression refers to multiple columns. Multiple columns caqnnot be converted to a scaler value".

      The Location field is the same on all records forgot to copy and paste them into it.