Forum Discussion
Can I use Numeric range parameter as a filter for TOP N filtering on a visual?
I want to link my Left visual that shows number of departures from each station with the numeric parameter on the right?
Like if the user wants to see top 5 station they can type 5 and just see them, or type 3/10/20 whatever is the max limit (I defined it as 50)
but not sure how to do that?
- Anonymous2 years ago
Hi, Nikhil091
Thanks for qqqqqwwwweeerrr reply. If it does not work, you can refer to the following DAX.DAX:
Categorys = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Category]))RANK = VAR _rank = RANKX('Table',CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Category])),,DESC,Dense) VAR _trueRank = DIVIDE(_rank,'Table'[Categorys]) RETURN _trueRankFlag = VAR _para = SELECTEDVALUE ( Parameter[Parameter] ) VAR _re = IF ( SUM('Table'[RANK]) <= _para, 1, 0 ) RETURN _reBest Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
2 Replies
- qqqqqwwwweeerrr
Solution Sage
Hi Nikhil091
You can check this video: https://youtu.be/cs2AwJljBrQ & https://youtu.be/O9Be1d_oi6Y here not exact but parameter are used to control top N.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@HowtosolveprobemRegards
- AnonymousNot applicable
Hi, Nikhil091
Thanks for qqqqqwwwweeerrr reply. If it does not work, you can refer to the following DAX.DAX:
Categorys = CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Category]))RANK = VAR _rank = RANKX('Table',CALCULATE(COUNTROWS('Table'),ALLEXCEPT('Table','Table'[Category])),,DESC,Dense) VAR _trueRank = DIVIDE(_rank,'Table'[Categorys]) RETURN _trueRankFlag = VAR _para = SELECTEDVALUE ( Parameter[Parameter] ) VAR _re = IF ( SUM('Table'[RANK]) <= _para, 1, 0 ) RETURN _reBest Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum