Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
smmoore34
Helper II
Helper II

bar chart show top 10 By Value is grayed out on fliter

i have a bar chart that shows traffic offenses on the Y and % of total offenses on the X. I only want to show the top 10. These are the steps I have taken:

1. Selected the visual

2. Filters on this visual

3. On the offense filter - select filter type as top N

4. Under show items , select top and enter quantity 10

 

From here I should be able to add a By Value but it is grayed out along with the apply Filter.

Any help is appreciated!!!

 

smmoore34_0-1714580782942.png

 

 

 

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @smmoore34 

 

Thanks for the reply from @Kishore_KVN , please allow me to provide another insight:

 

I tested it using sample data for your reference:

vxuxinyimsft_0-1714959827255.png

 

1. Create measure to get the percentage of Profit for each country.

% = 
VAR _sum = CALCULATE(SUM(financials[Profit]), ALL(financials))
VAR _sumby = CALCULATE(SUM([Profit]), ALLEXCEPT(financials, financials[Country]))
RETURN
DIVIDE(_sumby, _sum)

 

2. Create a measure to rank the %. Put the measure into the visual-level filters, set up show items when the value is 1. I show the top 3.

measure = 
VAR _rank = RANKX(ALL(financials), [%], , DESC, Dense)
RETURN
IF(_rank <= 3, 1, 0)

 

vxuxinyimsft_1-1714960322920.png

 

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.

View solution in original post

7 REPLIES 7
v-xuxinyi-msft
Community Support
Community Support

Hi @smmoore34 

 

Thanks for the reply from @Kishore_KVN , please allow me to provide another insight:

 

I tested it using sample data for your reference:

vxuxinyimsft_0-1714959827255.png

 

1. Create measure to get the percentage of Profit for each country.

% = 
VAR _sum = CALCULATE(SUM(financials[Profit]), ALL(financials))
VAR _sumby = CALCULATE(SUM([Profit]), ALLEXCEPT(financials, financials[Country]))
RETURN
DIVIDE(_sumby, _sum)

 

2. Create a measure to rank the %. Put the measure into the visual-level filters, set up show items when the value is 1. I show the top 3.

measure = 
VAR _rank = RANKX(ALL(financials), [%], , DESC, Dense)
RETURN
IF(_rank <= 3, 1, 0)

 

vxuxinyimsft_1-1714960322920.png

 

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.

Kishore_KVN
Super User
Super User

Hello @smmoore34 , 

you did everything right. Just add that percentage column or calculation that you have added in X-axis into the By Value Add Data Fields here (which is there in filters on this visual) as well and then click apply filters. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

Thanks for responding so quickly. The issue is that the By Value field is grayed out so I'm not able to add any data fields or values in it.

No I can still see that it is available. try to add data there. If possible share your sample pbix so that I can help you better. 

I'm afraid it's sensitive law enforcement data so I'm not able to share the dataset.

Thank you anyway!

Okay what you were trying to add here in the highlighted area. I mean which measure or column?smmoore34_0-1714580782942.png

 

There you have to add %total tickets issued measure. 

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

I want to add the measure "% of total tickets" here but I'm not able to add any field in the By value. When I click on "Add data fields here" - it is grayed out and I'm not able to add anything.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.