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! Request now

Reply
AndrewPF
Helper V
Helper V

display chart only when something else is filtered

My pseudodata looks like this: 

group item no. total sales
A 100 1250
A 110 48909
A 120 56015
B 220 6105
B 230 50189
B 245 15199
C 309 1016
C 308 1099
C 366 1019
etc.

and I want to put it on a chart, but I only want to show a single group at a time. 

I have a "group" slicer, a new measure: 

Total sales = if(isfiltered(DATASOURCE[group]), calculate(sum(DATASOURCE[Total sales])), 0)

and a chart which displays "Total sales" by "item no.".

This all works fine when I have selected something in the "group" slicer, but I want the chart to be blank unless something is selected.  At the moment, if nothing is selected in the "group" slicer, the chart contains everything i.e. all my item no.s, with blanks in every "Total sales". 

I can add a filter to the chart itself so that it only displays in the chart if sales is > 0, but ideally I want zero sales too. 

Any ideas? 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

HI  @AndrewPF ,

Pls test the below:

isfilter = CALCULATE (IF ( ISFILTERED ( 'Table'[Group] ), 1, 0 ),
    ALLSELECTED ( 'Table')
)

Out put result:

vluwangmsft_0-1663146351903.pngvluwangmsft_1-1663146361874.png

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

 

Best Regards,
Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

HI  @AndrewPF ,

Pls test the below:

isfilter = CALCULATE (IF ( ISFILTERED ( 'Table'[Group] ), 1, 0 ),
    ALLSELECTED ( 'Table')
)

Out put result:

vluwangmsft_0-1663146351903.pngvluwangmsft_1-1663146361874.png

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

 

Best Regards,
Lucien

AndrewPF
Helper V
Helper V

I think I get where you're coming from this, but I get the error message: 

"The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scalar Value."

amitchandak
Super User
Super User

@AndrewPF , Put a visual level filter for below measure =1

 

isfilter = int(if(isfiltered(DATASOURCE[group]), allselected()) )

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
Top Kudoed Authors