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.
I have a data set for points scored by players. The GameID is a string, and is unique for each player but two players can have the same GameID (in cases where they were in the opposing teams of a game).
Player,GameID,Points
A,ID1,12
A,ID2,33
A,ID3,44
A,ID4,6
A,ID5,3
A,ID6,86
A,ID7,43
A,ID8,77
A,ID9,4
A,ID10,94
B,ID3,44
B,ID12,66
B,ID33,8
C,ID5,34
C,ID7,64
C,ID8,55
C,ID44,34
C,ID55,25
C,ID66,3
I want to display a summary of the players total points and average, as well as use this data in other visuals. Suppose I display a summary in a table like this.
Now I would like the user to give the opportunity to filter this visual using a Slicer, and I want the # games played by each player to be the filter. For instace, say I want the user to be able to fitler this visual and display stats for players who have played 5 or more games, so in this case the visual will exclude Player B after filtering.
Due to limitations/reasons in my actual project, I want the Count of GameID (instead of, say, Count of Player or Count of Points) to be the filter field in the Slicer.
But now I'm facing a problem because it won't allow me to use the count of GameID in a Slicer. I could create a measure for CountGameID, but it wouldn't let me use a measure in a slicer either.
Is there any way to get the result I want? I specifically don't want to use the Filters pane, but use a slicer (or any other visual) to do the filtering.
Solved! Go to Solution.
@Anonymous here is the updated measure and between will work
Filter Games Count =
VAR __min = MIN ( 'Filter Games'[Filter Games] )
VAR __max = MAX ( 'Filter Games'[Filter Games] )
RETURN
IF ( [Games] >= __min && [Games] <= __max , 1, 0 )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous here is the updated measure and between will work
Filter Games Count =
VAR __min = MIN ( 'Filter Games'[Filter Games] )
VAR __max = MAX ( 'Filter Games'[Filter Games] )
RETURN
IF ( [Games] >= __min && [Games] <= __max , 1, 0 )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Yup, that worked like a charm! And I think I got the concept behind now. Appreciate the help.
so if you want between you just need to tweak the measure
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
You can make a separate table with GENERATESERIES(1,10,1) for example and use the Value column from that in your slicer. You can then make a measure where the distinct count of Games played equals the SELECTEDVALUE from the slicer.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous use what-if parameter to get this going, see the attached solution, tweak it as per your needs.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks for the reply!
This worked - sort of. It definitely works for the lower limit (single filter), but if change the slicer to a 'Between' then even the lower limit doesn't seem to work. I'm guessing I need to add a similar max filter?
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |