Forum Discussion
How to make an interactive formula with a filter
I am trying to make my cards be filtered and calculated using my filters... but they don't seem to be working.
I have my formula - and it takes the total revenue, and divides by the count of how many patients there are... but I want it to filter with each practice.
I want to click on one practice, and the average patient revenue is connected to that (that practices revenue / that practices count of patients)
Thanks in advance,
Anonymous , Try like
AvgRevenue Per Patient = [Revenue] / CALCULATE(DISTINCTCOUNT('public view_patients'[patient_key]), FILTER('public view_practices', 'public view_practices'[name] in ('public view_practices'[name])))
I think even this should work
AvgRevenue Per Patient = [Revenue] / CALCULATE(DISTINCTCOUNT('public view_patients'[patient_key]))
2 Replies
- amitchandak
Super User
Anonymous , Try like
AvgRevenue Per Patient = [Revenue] / CALCULATE(DISTINCTCOUNT('public view_patients'[patient_key]), FILTER('public view_practices', 'public view_practices'[name] in ('public view_practices'[name])))
I think even this should work
AvgRevenue Per Patient = [Revenue] / CALCULATE(DISTINCTCOUNT('public view_patients'[patient_key]))
- AnonymousNot applicable
Neither of those worked.....
the first one gave me an error about the in statement, and the other one is what I had at once, but doesn't filter correctly. I am suppose to get values like in their 30-40s but I'm getting numbers under 15