Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

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!
1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

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.

080504.jpg

 

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

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

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.

080504.jpg

 

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

amitchandak
Super User
Super User

@Syndicate_Admin , This approach will work when Practices[Prescriptions] is an independent table

 

But not very clear what you want

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.