Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have table "A" with "Col1" and "Col2" columns, both of which contain just TRUE or FALSE values. In that table are also many other columns. In another disconnected table "B" I have just one column with two rows with the names of these two columns, "Col1" and "Col2".
Now, in slicer user selects for example "Col1". I want to show visuals only for rows from table "A" which contain TRUE in "Col1".
In other words, how to dynamically select column ("Col1" or "Col2") and show visuals just for TRUE values in that selected column.
Thank you for advice.
Found solution:
Hi , @harry_pbi
According to your description, you want to "dynamic selection of column and showing visuals just for a specific value from that column".
Here are the steps you can refer to :
(1)This is my test data:
(2)We can create a measure :
Measure = var _slicer = VALUES('Table 2'[Value])
var _Col1=SELECTEDVALUE('Table'[Col1])
var _Col2 = SELECTEDVALUE('Table'[Col2])
return
IF( NOT(ISFILTERED('Table 2'[Value])),1,
IF(OR( {"Col1"} in _slicer && _Col1 = TRUE() ,{"Col2"} in _slicer && _Col2 = TRUE()) ,1,0))
(3)Then we can put the measure on the "Filter on thsi visual" and we can get the result as follows:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Aniya,
thank you for your reply. I've tried it and found this issues:
Let's add another "Table" viz which contains just "Index" column, with the "Filter on this visual" set as you proposed.
And let's change the value of "Index" in the second row from 2 to 1 in the first "Table" to create the situation, where for one value in "Col1" exist two different values of TRUE and FALSE in "Col2".
Now if we select "Col2" in the slicer, we get in that new viz just 3,7,8,9,10 without 1.
Or if we add "Card" viz with the sum of "Index" we get 54 instead of 38 without the option to define "Filter on this visual" with your "Measure".
I have data, where one online campaign may belogn to more categories ("Mobile" ~ "Col1", "TV" ~ "Col2",...) and user can select which category wants to see. For example trend of impressions over the year by week in Line chart for category "TV".
The column "TV" is not present in that viz, it's used just for filtering.
Do you have any idea, how to deal with that?
Thank you.
harry
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
103 | |
99 | |
98 | |
38 | |
37 |
User | Count |
---|---|
151 | |
121 | |
73 | |
71 | |
63 |