Forum Discussion

laurentalp's avatar
laurentalp
Frequent Visitor
4 years ago
Solved

Filter a column using other column in the same table

I have a table with all procedures from a hospital, but with more fields that I use in another page.

Like this:

(let's call this table 'PROCEDURES')

ProcedureRequesting doctor specialtyPerforming doctor specialtyQTDpricedate (dd/mm/yyyy)
Examcardiologycardiology210010/04/2022
Examorthopedicsorthopedics15001/04/2022
medical appointment orthopedics112003/04/2022
medical appointment psychiatry112004/04/2022
Examorthopedicsradiology14001/04/2022
Examorthopedicsradiology32004/04/2022
Examcardiologyradiology11503/04/2022
medical appointment cardiology112012/04/2022

 

In the first visual, I have a sum of all medical appointments by Performing Dr. (using a measure to filter proceduresand sum QTD and a calendar table):


Measure is (simplified) like this:

appointment =
calculate
(
SUM(PROCEDURE[QTD]),
USERELATIONSHIP('#Calendar'[Dates],PROCEDURES[DATE]),
PROCEDURES[Procedure] IN{
'medical appointment'},
FILTER('#Calendar','#Calendar'[LM]="TRUE") -- this part is for filter only the last month
)
 

In the next visual I have all exams:

 

Usign a measure, similar to the first, but filtering Exams.

 

But if I choose a colunm in the first, it will filter Exams by Perfoming Doctor, which is not what I want.

 

I want to click on the first visual which is ordered by "Performing doctor specialty" and filter only exams using as "Requesting doctor specialty".

 

Example:

Perfoming Doctor:

 

In a table, it will filter this:

Procedure Kindspecialty Requesting doctorspecialty Performing doctor QTDpricedate
Examcardiologycardiology210012/04/2022
Examcardiologyradiology11512/04/2022

 

 

I'm thinking about a measure Exam that use Performing Doctor filter from the first as Specialty Doctor in the second, is it possible?

  • I achieved the result using other solution:
    Instead all procedures in one table, I made one table with only medical appointments and other with exams and other procedures, and created a relationship between performing doctor on table A and requesting doctor on table B.

7 Replies

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

    Hi, laurentalp ;

    You should add another table from [Performing doctor specialty] column ;

    filter = VALUES('Table'[Performing doctor specialty])

    Then create a flag measure.

    flag = 
    IF (
        ISFILTERED ( 'filter'[Performing doctor specialty] ),
        IF (
            MAX ( 'Table'[Requesting doctor specialty] )
                IN ALLSELECTED ( 'filter'[Performing doctor specialty] ),
            1,
            0
        ),
        1
    )
    

    add the visual filter.

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • laurentalp's avatar
      laurentalp
      Frequent Visitor

      Thanks for your reply.
      It's almost what I need, but in first table I need total appointments per "Performing doctor specialty" too, not only use as a filter. I tried to use a relationship, but it use the relationship for filter, which i don't want to.

  • laurentalp , visual will only pass the non summarized column and ant slicer. In filter forced in measure will not pass. for that you can use the measure in first visual as visual level filter in second visual

    • laurentalp's avatar
      laurentalp
      Frequent Visitor

      Thank you by your reply, I will try another way

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

    Hi, laurentalp ;

    You could share a simple file and show the result what you want to output.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

    Hi, laurentalp ;

    Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • laurentalp's avatar
    laurentalp
    Frequent Visitor

    I achieved the result using other solution:
    Instead all procedures in one table, I made one table with only medical appointments and other with exams and other procedures, and created a relationship between performing doctor on table A and requesting doctor on table B.