Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
88 | |
83 | |
64 | |
49 |
User | Count |
---|---|
127 | |
108 | |
87 | |
70 | |
66 |