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
whytheq
Frequent Visitor

Choice in donut chart seemingly not being passed to my filter

I have this data:

 

CaptureA.JPG

 

Then I have this donut of Fruit and their total values:

 

CaptureB.JPG

 

 

I have this measure to pick-up which fruit has been selected in the above donut:

 

    Selected Fruit = SELECTEDVALUE( Fruit[Fruit] )

 

It seems to work fine e.g. if I add this measure to a card and click Pear:

 

CaptureC.JPG

 

 

Now comes the problem - I have a bar chart **which has to have interactions turned off** but still needs to be filtered by what has been selected in the donut - so I created this measure:

 

Value Filtered =
CALCULATE(
    SUM(Fruit[Value])
    ,FILTER(
        Fruit
       ,Fruit[Fruit] = [Selected Fruit]
     )
)

 

But now when I click Pear it changes the text in the card but has no impact on the chart - what am I doing wrong?

 


CaptureD.JPG

1 ACCEPTED SOLUTION

@whytheq

Thanks for the additional info - I see the problem.

 

I assume you are applying your date range filters using Visal Level Filters?

Unfortunately when you click a slice of the Donut, say "Apple", both the filters Fruit = "Apple" and Date = <Donut date visual level filter> are passed to the Column chart.

 

I think your best bet is to use slicers for your date filters rather than visual level filters. This way, they are not considered part of the Donut (or Column) visuals and won't be passed from one chart to the other. You can also hide the slicers if you don't want them cluttering the report.

 

Here is a very simple example (pbix) - I just modified your sample data with your original values on 1-Jan-2018 and doubled values on 1-Feb-2018.

 

With the slicers visible it looks like this, but you can hide the slicers and the effect is practically the same as VIsual Level Filters:image.png

 

By the way, using the original Visual Level Filters, I can't see any way to make this work with DAX, because DAX has no way of distinguishing between the Visual Level Filter on the Column chart and the date filter passed from the Donut chart - they appear to be simply intersected into one Date filter.

 

Regards,

Owen

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
OwenAuger
Super User
Super User

Hi @whytheq

 

Why does the bar chart need interactions turned off? What effect were you looking for?

 

If you turn off interactions from donut chart to bar chart, any filters applied on the donut chart cannot influence the bar chart at all.

Whether you display Value Filtered or any other measure on the bar chart, it will have no idea about filters applied on the donut, so the DAX expression for any measure used on the bar chart is evaluated in an unfiltered filter context.

 

 

Turning on interactions to "filter" (from donut to bar chart) would be the simplest way to apply the donut filter to the bar chart.

You could turn off interactions from other visuals and just keep interactions from the donut if that's what you wanted.

 

There is a secondary issue with the Value Filter measure, in that the FILTER(...) has no effect. This is because when [Selected Fruit] is evaluated in the row context of Fruit, it just returns the Fruit value from that row (due to context transition), so the condition within FILTER is always true. To make a measure like this work, you can store the value of [Selected Fruit] in a variable:

Value Filtered =
VAR SelectedFruit = [Selected Fruit]
RETURN
    CALCULATE (
        SUM ( Fruit[Value] ),
        FILTER ( Fruit, Fruit[Fruit] = SelectedFruit )
    )

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi Owen,

 

Thanks for the response - this is just a mock-up of my more complex report - in the real report both the donut and the barchart of filtered by Date - the donut is 30 days and the bar chart 90 days - so I do not want the date context of the donut to interact with the bar chart. This is the reason that I have to turn ineraction off and find a way to just move the Fruit filter context from donut to bar chart.

 

I tested your DAX and I agree that it looks like it should work but it doesn't work in my power bi.

 

Rgds

J

@whytheq

Thanks for the additional info - I see the problem.

 

I assume you are applying your date range filters using Visal Level Filters?

Unfortunately when you click a slice of the Donut, say "Apple", both the filters Fruit = "Apple" and Date = <Donut date visual level filter> are passed to the Column chart.

 

I think your best bet is to use slicers for your date filters rather than visual level filters. This way, they are not considered part of the Donut (or Column) visuals and won't be passed from one chart to the other. You can also hide the slicers if you don't want them cluttering the report.

 

Here is a very simple example (pbix) - I just modified your sample data with your original values on 1-Jan-2018 and doubled values on 1-Feb-2018.

 

With the slicers visible it looks like this, but you can hide the slicers and the effect is practically the same as VIsual Level Filters:image.png

 

By the way, using the original Visual Level Filters, I can't see any way to make this work with DAX, because DAX has no way of distinguishing between the Visual Level Filter on the Column chart and the date filter passed from the Donut chart - they appear to be simply intersected into one Date filter.

 

Regards,

Owen

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

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