Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
5 years ago
Solved

SEGMENTATION OF DATA WITH FILTERS

Hello, I am trying to get the total practices prescribed by doctor. I have two tables on the one hand all the consultations that the doctor attended and on the other all the practices carried out. I was able to apply a series of measurements and calculations but I can't make the data segmentation work for me.

vgalvan_1-1628005851265.png

The practical column Matrix I calculate using two measures the first counts all the columns of a table:

Practices = COUNTROWS('RawDevAmbulatory Practices')
The second thing I do is calculate how many densitometry practices there are
Densito Practices = CALCULATE([Practices],FILTER('RawDev Wandering Practices','RawDev Wandering Practices'[PracticaID (groups)]="DENSITOMETRIES"))
The last thing I do is show me the total of those practices in the densitometry column.
Practices Matrix =
var Selected Column = SELECTEDVALUE(Practices[Prescriptions])
return
switch (Selected Column,"DENSITO",[DENSITO Practices])
The point is that I don't segment the calculation by doctor. What I want to get is how many practices of the doctor "X" are densitometries. And in return he brings me in each row the total number of densitometry practices.
How do I make the segmentation of data by medical headquarters and service apply?
Thank you!
  • Hi Syndicate_Admin 

     

    You can use the following measures

    Practicas Densitometria 2 =
    COUNTROWS (
        FILTER (
            Practicas,
            Practicas[PRACTICA] = "DENSITOMETRIA"
                && Practicas[MEDICO] IN VALUES ( 'Atencion en Consultorios'[MEDICO] )
        )
    )
    
    Practicas RX 2 =
    COUNTROWS (
        FILTER (
            Practicas,
            Practicas[PRACTICA] = "RX"
                && Practicas[MEDICO] IN VALUES ( 'Atencion en Consultorios'[MEDICO] )
        )
    )
    

     

    Or create a relationship between two tables on MEDICO columns. Then your original measures also work.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

3 Replies