March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
32 | |
24 | |
12 | |
11 | |
9 |
User | Count |
---|---|
47 | |
46 | |
23 | |
12 | |
9 |