Bypass filter/parameter inside a calculated field

Hello! I have a table of prescriptions, with the columns laboratory, idvmp and idprescription. I need to count the distinct quantity of idprescriptions when i filter the column laboratory. But I dont want to count just the idprescriptions of the filtered lab… I filter the laboratory just to get the idvpms associated with it. But other laboratories can have medicines with the same idvmps from that lab, so it needs to count all

Hi @MichaelFer and welcome to the QuickSight community!
Apologies from the community on your topic not being answered yet. One quick note when posting, when you add a comment on one of your posts, it removes the post from the ‘new’ section which could lead to an instance like this. So I would suggest editing your original post as opposed to adding another comment for future reference!

In regards to your question, I would suggest trying out a distinctCount calculation, adding ‘PRE_FILTER’ should assist in getting your count prior to the filtering of laboratories. I’ve attached an article that explores this a bit further in depth for reference.

Let me know if you have any additional questions!