Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all!
I'm working with slicers and have a special need I'm not being able to solve...for now.
I have a table with users of a public library:
User ID | User Name |
1 | Samuel |
2 | Christine |
3 | Marcus |
4 | Jessica |
Another table with the books they have checked out:
Book | User ID | Currently_reading |
The Catcher In The Rye | 1 | False |
1984 | 1 | False |
Ulysses | 1 | True |
A Clockwork Orange | 2 | False |
David Copperfield | 2 | False |
The Picture Of Dorian Gray | 2 | True |
Dracula | 3 | False |
The Great Gatsby | 3 | True |
Brave New World | 4 | False |
The Grapes Of Wrath | 4 | True |
And I have two slicers:
- one for users names
- one to check the books that these users are currently reading (or not), with values True or False.
And one table with the book titles for each user, with a single column.
What I want is the following:
- If the second filter is not selected (the one with values True or False), I want to be shown by default the titles with Currently_reading=true, that is, the ones that they are currently reading (in the case of Samuel it would be Ulysses, in the case of Christine, The Picture Of Dorian Gray, etc.).
How can I do this? I'm struggling with this problem since Wednesday and I can't find a solution. I hope you can help me!
Regards
Hi @Anonymous
Could you tell me if your problem has been solved? If it is, kindly Accept the helpful reply as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problems.
Best Regards,
Rico Zhou
@Anonymous
The solution suggested above does work. Absolutely. See it in the attached file.
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @AlB , unfortunately I'm not able to share pbix files, but I'll try to be as graphic as possible:
The two source files I'm using for this example are just csv files with this content:
users.csv:
ID_user;Name_user
1;Samuel
2;Anna
3;Christine
4;Marcus
books.csv:
Book;User ID;Currently_reading
The Catcher In The Rye;1;False
1984;1;False
Ulysses;1;True
A Clockwork Orange;2;False
David Copperfield;2;False
The Picture Of Dorian Gray;2;True
Dracula;3;False
The Great Gatsby;3;True
Brave New World;4;False
The Grapes Of Wrath;4;True
Once files are imported, the relationship between books and users table is through User ID:
My dashboard is very simple, just like this:
The slicer in the left contains the field Name_user from table users and the one in the right, the field Currently_reading from table books, and as you can see, the table contains the Book field and the Currenty_reading field.
What I want is, when no option is checked in Currently_reading, I want only values with True to be shown (in the case of Samuel, Ulysses)
Thank you very much!
@Anonymous
Can you ideally share a simple pbix that reproduces the issue? Or the actual pbix if possible.
That would be fastest
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
I would need some more details but you could create a measure :
Show Measure =
IF (
CALCULATE (
NOT ISFILTERED ( Table2[Currently Reading] ),
ALLSELECTED ( Table2[Currently Reading] )
),
IF ( SELECTEDVALUE ( Table2[Currently Reading] ), 1, 0 ),
1
)
and apply it as a filter to your with "Show when value is 1"
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @AlB ! What other details do you need? I've tried your solutions but it doesn't seem to work 😞
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |