Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi guys!
I have the following bar chart where the users are able to switch between two measures, Numeric and Percentage measure.
Now on this tail analysis visual, I have hundreds of ids that go from the best to the worst, given what measure is selected.
My users have now a requirement to add a Top/Bottom N button on the report, so that they can simply visually see both top/bottom 10 ids on the bar chart, given what measure is selected.
On paper it sounds relatively easy, but I am unable to produce such thing via DAX at the moment.
Has anyone had a similira requirement in the past? How did you solve it?
Thanks a bunch!
Hey Jayleny,
I will give it a try but I am not sure whether it is 100% the output I'm looking.
I'd like to see Top/Bottom N on the bar chart at the same time. So they're both there, both sides of the tail, comparable to each-other.
I'll try with parameter and dynamic measure tho 👌
Hi @Meeskass
First, you'll need to create a parameter that allows users to choose between viewing the Top N or Bottom N items.
Next, you'll create a dynamic measure that responds to the parameter and switches between your top/buttom10 measures based on user selection.
Dynamic Measure =
VAR SelectedMeasure = [Your Measure Switch Logic Here]
VAR TopBottomValue = SELECTEDVALUE('TopBottomN'[Value], 0)
RETURN
IF(
TopBottomValue = 0,
SelectedMeasure,
IF(
TopBottomValue > 0,
TOPN(TopBottomValue, ALL('YourTable'[ID]), SelectedMeasure, DESC),
TOPN(ABS(TopBottomValue), ALL('YourTable'[ID]), SelectedMeasure, ASC)
)
)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.