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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
hayleedee
New Member

Group by and count one column to divide over different categories of the column - tooltip

I have a bar chart with counts by "ln" on the left and split by "ment" for each category of "ln"

I would like a tooltip which shows the proportion of the red to the green for each "ln" - however, my current calculation excludes the green when hovering over the red as of course the data within there is only for the red.

How can I create a measure which by passes that category while counting them seperately?

ln_by_ment.png

Thanks for your help.

1 ACCEPTED SOLUTION
hayleedee
New Member

Thanks very much - that got me started in the right direction.

Here is my final solution that produced the ratio of red to green:

ratio_of_red2green = CALCULATE(COUNT('Final_dataset'[ln]), FILTER(ALLEXCEPT(Final_dataset,Final_dataset[ln]),Final_dataset[ment] = "RED"))/CALCULATE(COUNT(Final_dataset[ln]), FILTER(ALLEXCEPT(Final_dataset, Final_dataset[ln]), Final_dataset[ment] = "GREEN"))
Thanks all 👍

View solution in original post

4 REPLIES 4
hayleedee
New Member

Thanks very much - that got me started in the right direction.

Here is my final solution that produced the ratio of red to green:

ratio_of_red2green = CALCULATE(COUNT('Final_dataset'[ln]), FILTER(ALLEXCEPT(Final_dataset,Final_dataset[ln]),Final_dataset[ment] = "RED"))/CALCULATE(COUNT(Final_dataset[ln]), FILTER(ALLEXCEPT(Final_dataset, Final_dataset[ln]), Final_dataset[ment] = "GREEN"))
Thanks all 👍
v-yingjl
Community Support
Community Support

Hi @hayleedee ,

You can create a measure like this to use it as tooltip:

percent =
CALCULATE (
    COUNT ( 'Table'[In] ),
    FILTER ( ALLEXCEPT ( 'Table', 'Table'[In] ), 'Table'[ment] = "green" )
)
    / CALCULATE ( COUNT ( 'Table'[In] ), ALLEXCEPT ( 'Table', 'Table'[In] ) )

per.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hayleedee
New Member

Apologies, I realised I said proportion and I meant ratio.

But the above has worked to give me the proportion - however, I should have said the ratio of the green to the red. Ideally it would be the same value for both the red and green tooltip, but not necessary.

amitchandak
Super User
Super User

@hayleedee , Assuming column in the axis is In

 


divide([measure], calculate([measure], filter(allselected(Table), Table[In] = max(Table[In]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors