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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Is their a HASONEFILTER option, but checking for multiple filters?

I have a pie chart with 3 categories and aggregated sales for the value of each.

 

I have a line chart that I want to display the sum of all 3 categories with dates on my axis.

 

If one value in the pie chart is selected, I want the line chart to show only the sum of that category on the axis.

 

Here is the tricky part... if 2 or more categories are selected on the pie chart, I need to display each category as a separate line on the line chart. NOT an aggregate.

 

I am thinking that the best way to do this is to simply have 2 line charts overlapping and utilize a function like:

IF ( ISFILTERED(table[column]),[Sum of Category], BLANK())

 

Or maybe use HASONEFILTER()?

 

Basically, I am wondering how I can check to see if 2 or more filters are applied to the line chart and if so, hide one line chart and simply display a normal line chart in its' place.

5 REPLIES 5
amitchandak
Super User
Super User

@black_magic1001 , One of the ways, I can think of is having category as the legend in line visual. Only thing is that, when nothing is selected , you will see all category

Category is the legend.

 

I am trying to hide the chart if there are more than 2 categories selected.  Instead of HASONEFILTER() function I need a function like "HasTwoOrMoreFilters()".

UPDATE:
Attempt 3 test = IF(HASONEFILTER(ContractPurchases[PackageID]) || ISFILTERED(ContractPurchases[PackageID]) = False,[sumTEST], BLANK())
 
Attempt 4 test = IF(HASONEFILTER(ContractPurchases[PackageID]) = FALSE && ISFILTERED(ContractPurchases[PackageID]) = TRUE,[sumTEST], BLANK())
 
This is where I am currently, but in Attempt 4 Test I need to show multiple lines.  Right now I am displaying a single sum.

@black_magic1001 , You can simply do a count

if(count(ContractPurchases[PackageID]) >=2, blank(),[sumTEST])

Ok but that still does not answer the question of how to show multiple lines on the graph when 2 or more filters are chosen. [sumTEST] is just the sum of the column I want to see.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.