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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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

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

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])

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

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.