Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello everyone,
Need to add logic that would make possible to hide Y axis category bar when one of the values in legend for this category is lower than for example 9.
for example Canada , have 8 in blak category, so it should be hidden, whole Canada should be removed from chart, same Finlad and etc.
I did some calculations but nothing seems to work so far.
Solved! Go to Solution.
Hi @Irek
Here's an example of what I did that might help you.
My sample:
Create several measures as follow
ForRank = SUM('Table'[Value])
rank = RANKX(ALLEXCEPT('Table', 'Table'[Country]), [ForRank], , ASC, Dense)
less =
VAR _min = MINX(FILTER(ALL('Table'), [Value] < 3), [rank])
VAR _minValue = CALCULATE(MAX('Table'[Value]), FILTER(ALLEXCEPT('Table', 'Table'[Country]), [rank] = _min))
VAR _second = _min + 1
VAR _secondValue = CALCULATE(MAX('Table'[Value]), FILTER(ALLEXCEPT('Table', 'Table'[Country]), [rank] = _second))
RETURN
IF(MAX([Value]) = _minValue || MAX([Value]) = _secondValue, 0, 1)
Put the measure into the visual-level filters, set up show items when the value is 1.
Result:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Irek
In order to better help you, I need to confirm your logic with you. According to your description, do you mean to hide the corresponding bar when the Values of any Legend is less than 9?
According to my judgment, in your diagram, the "Address" of each location is less than 9.
Here's the data I've restored so far. If this it is structurally different from the one you are using, please do not hesitate to mention it and I will modify it.
Best Regards,
Yulia Xu
I have new requirment from client. Now I should hide only category that is smaller than 3, what is easy.
Second part of request is harder for me , in case when one category is smaller than 3 , this category should be hidden and also second small category shoudl be hidden.
For example Indonesia from chart picure i attached.
It should have hidden Addreess beacuse it have 2 , Leap aslo 2 and Blank becuase is second small after this two.
Hi @Irek
Here's an example of what I did that might help you.
My sample:
Create several measures as follow
ForRank = SUM('Table'[Value])
rank = RANKX(ALLEXCEPT('Table', 'Table'[Country]), [ForRank], , ASC, Dense)
less =
VAR _min = MINX(FILTER(ALL('Table'), [Value] < 3), [rank])
VAR _minValue = CALCULATE(MAX('Table'[Value]), FILTER(ALLEXCEPT('Table', 'Table'[Country]), [rank] = _min))
VAR _second = _min + 1
VAR _secondValue = CALCULATE(MAX('Table'[Value]), FILTER(ALLEXCEPT('Table', 'Table'[Country]), [rank] = _second))
RETURN
IF(MAX([Value]) = _minValue || MAX([Value]) = _secondValue, 0, 1)
Put the measure into the visual-level filters, set up show items when the value is 1.
Result:
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yulia,
Hi Yulia,
yes, in my example "Adress" have less than 10 for all location, in "real" data it looks a little bit different. but for this task we can assume that minimal should be 3. Every country with value less than 3 for any category in legend should be hidden in visual.
Thank you
Marcin
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
120 | |
74 | |
72 | |
63 |