Forum Discussion
Hide data in power bi visual until a filter was selected.
- Anonymous6 years ago
Hi sugra
Due to I don’t know your data model, and the result you want to get, I create a sample to have a test.
I build Table_1 in SQL Sever and get data in DirectQuery model.
Table_1:
Then I try your way:
QuestionSelectCheck2 = IF(HASONEFILTER('Table_1'[X]),1,2)Drag the measure into Filters on this visual and select 1.
Result is as below:
Select a:
My result is correct.
If you still can’t use this way in DirectQuery, you can try my way.
Measure = IF(ISFILTERED(Table_1[X]),1,BLANK())OR
Measure = IF(HASONEFILTER(Table_1[X]),1,BLANK())NOTE: We need to keep all rows the same as below.
Result :
Select a:
If we use ISFILTERED we can make complex select:
If this reply still can’t help you solve your problem, please provide me your data source, the visual of the result you want or the visual of the problem.
You can download the pbix file form this link:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
in my test the second step fails as the filter options do not expose the enumerated values of the measure. What worked for me was to replace all columns of the visual with measures that were controlled by the HASONEFILTER() measure.
- sugra6 years ago
Helper I
Hi Ibelin,
Thanks for taking the time to respond to my question. I have many columns in my tables and need to keep them at the detail level (not aggregated). Could you give an example of how you did this?
"...replace all columns of the visual with measures that were controlled by the HASONEFILTER() measure..."