Forum Discussion
DAX - Simple Table FILTER not working with SELECTEDVALUE
- 4 years ago
My colleague found a good solution to this problem. It's definitely a work-around but it's better than the workaround I was using.
Measure Code:
SelectedEmail = IF(HASONEFILTER('Upgrade Details'[Email]), 1, BLANK())Then the Measure is added to the very end of the table, renamed to "_" (so it takes up minimal space) and the column is reduced so it can't be seen. The other columns have to be set to not aggregate. Now, the table on the right will only show data if a single email value is selected on the left. 😁
Yeah, but if I don't want anything to show in the table (because it's not relevant until something is selected on the matrix) I have to do something like this which I've done but it comes with a lot of headaches like...
- It's hard to edit the report because there is a transparent card in the front of the table all the time.
- I have to allow users to see the scrollbar at all times otherwise they can't select it because the transparent card visual is in the foreground.
As I said, this is a really basic example. What I was hoping to do is take the data from the matrix visual, filter a table with one unique value (email address in the real world) and then pivot on something else entirely while joining in another table of values to calculate some totals. I've defaulted to doing it all in PowerQuery which I'm comfortable with, but I was hoping that more of it could be done on the DAX side so filter context could be maintained.
This is what I have...
Card in front of table that becomes transparent when email address is selected
I see. I can't think of a better solution at the moment.
A different approach would be to make a dropdown email slicer (that doesn't filter the left matrix) with a forced single selection. This has different drawbacks but might work in some similar situations.