Forum Discussion
Use DAX Measure to filter current page, drillthrough too
- 2 years ago
Just for the record for the forum moderators, my original question doesn't really have a solution, only workarounds. For example, a visual like a card that displays a measure that includes a filter can't be used for true drill-through, but my workaround was to create a transparent button as an overlay on the card and have it navigate to a detail page that contains the same filters as the measure. This works fine for a small number of measures, but yes would be cumbersome for more than 5-6 from a user perspective, nevermind having to create many detail pages with only one specific purpose.
Yes, that's just the way measures work.
There are alternatives, for instance you could remove that filter on regType from that measure and instead apply that filter to the page or the visuals where you need them. If you want to display that other value in there, ignoring the filter, you can modify that measure and expand the context using ALL(
fPatientAccount[RegType]).
Also, for best performance use DISTINCTCOUNT(fPatientAccount[AccountNumber]) instead of that COUNTX. That is if you want to have the distinct number of accounts, because COUNTX doesn't give you that....
sjoerdvn wrote:Also, for best performance use DISTINCTCOUNT(fPatientAccount[AccountNumber]) instead of that COUNTX. That is if you want to have the distinct number of accounts, because COUNTX doesn't give you that....
Thanks. I'm not using DISTINCTCOUNT since my fact table granularity is already 1 row per account. In this case, is there still any benefit to using DISTINCTCOUNT over COUNTX?
- sjoerdvn2 years ago
Solution Sage
Yes. In this case you might also use COUNT. Try to avoid any X functions unless really necessary, because they will cause a loop executing an expression over all the rows in the table expression. If this is done over a large fact table, it will be slow.