cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

ISFILTERED with interacting graphs

Hello, I have two interacting graphs: line chart with 3 points (at Q4 2018, Q1 2019 and Q2 2019) and a donut chart. When I click to the data point on the line graph (picking Q2 2019, for example), my donut chart is adjusting, showing the data breakdown for this quarter. The issue is following: if I do not choose particularly any of the quarters on a line graph (so all of them is selected), my donut chart show the aggregate breakdown, summing all 3 quarters. What I need is that if no particular point on a line graph is chosen, the donut chart shows the breakdown of Q2 2019 ONLY. First option is to make a button with "please pick a quarter" inscription, but I wonder whether it is possible to fix the graph on Q2 2019 in case no other particular quarter is chosen.

 

I guess, it should be logically like this: "if(table has a filter; show this filter;  filter the last recent quarter)". The first step I think can be solved with "ISFILTERED". As a result, I wrote this, but it returns an error "Argument '2' in IF function is required.". Here is my code:
Measure = IF(ISFILTERED('Table_for_line_chart'[Quarter]);;FILTER('table_for_donut_chart';'table_for_donut_chart'[Quarter]="2019 Q2"))

I guess the problem is that It do nothing in case of Isfiltered = true. Or should I use the table_for_donut_chart'[Quarter] in ISFILTERED instead? Also it is not clear what should I do with such a measure: should I just add it on a donut chart or replace the quarter with it..?

 

Many thanks for your help!!
Natalia

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: ISFILTERED with interacting graphs

Hi @Natalia1234 ,

 

Based on my test, you could create a measure and put it into the values of the donut chart. The following is my sample you can have a try.

Measure = 
var maxd = CALCULATE(MAX('Table1'[Date]),ALL(Table1))
var a = SELECTEDVALUE('Table1'[Date])
var b = CALCULATE(SUM(Table1[Values]),FILTER('Table1',Table1[Date] = a))
var c = CALCULATE(SUM(Table1[Values]),FILTER(Table1,Table1[Date] = maxd))
return  
IF(ISFILTERED('Table1'[Date]),b,c)

1.PNG

2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: ISFILTERED with interacting graphs

Hi @Natalia1234 ,

 

Based on my test, you could create a measure and put it into the values of the donut chart. The following is my sample you can have a try.

Measure = 
var maxd = CALCULATE(MAX('Table1'[Date]),ALL(Table1))
var a = SELECTEDVALUE('Table1'[Date])
var b = CALCULATE(SUM(Table1[Values]),FILTER('Table1',Table1[Date] = a))
var c = CALCULATE(SUM(Table1[Values]),FILTER(Table1,Table1[Date] = maxd))
return  
IF(ISFILTERED('Table1'[Date]),b,c)

1.PNG

2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

Highlighted
Community Support
Community Support

Re: ISFILTERED with interacting graphs

Hi @Natalia1234 ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

 

Best Regards,

Xue

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors