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
PBNikr
Helper I
Helper I

Blank as default in line chart when no slicer values are selected

 

I have a report where employees are selected from a slicer and a line appears in the line chart for each employee. However, when no employees are selected (by default) I have this crazy line chart that shows all employees in the same chart:

 

See image here: Crazy line chart

 

I have tried to work with some DAX to blank out the values if no filter values are selected but with no luck:

 

Choose Employee = 
        IF(
           ISFILTERED('Employee'[Name]);
                          CALCULATE(Table[% Value]); BLANK()
             )

The code above doesn't really do anything. Any idea on how I can get this to work? 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @PBNikr

 

Try this, a slight variation on what you already had:

 

Choose Employee =
IF (
    CALCULATE ( ISFILTERED ( 'Employee'[Name] ); ALLSELECTED ( 'Employee'[Name] ) );
    CALCULATE ( Table[% Value] )
)

 

 

 

View solution in original post

5 REPLIES 5
JAKannan07
New Member

HI @PBNikr,

Make use of it

Selection = INT(if(ISFILTERED('Final Results'[Location]),1,0)) and drag this measure into visual filter. Make the value is 1 and apply filter.
AlB
Super User
Super User

Hi @PBNikr

 

Try this, a slight variation on what you already had:

 

Choose Employee =
IF (
    CALCULATE ( ISFILTERED ( 'Employee'[Name] ); ALLSELECTED ( 'Employee'[Name] ) );
    CALCULATE ( Table[% Value] )
)

 

 

 

Thanks AIB for the post. What could I replace for the part in the blue text below:

 

Choose Employee =
IF (
    CALCULATE ( ISFILTERED ( 'Employee'[Name] ); ALLSELECTED ( 'Employee'[Name] ) );
    CALCULATE ( Table[% Value] )
)

I have attempted your DAX on a similar situation with overwhelming linegraph (x-axis = year, y-axis = index score, legend = country names), but not sure what to replace for that piece (and the DAX won't work if I don't complete the requirements for 3 arguments). Have also used an INT(ISFILTERED(table[column])) function to attempt this filter and also doesn't work... I'm assuming because of my complication of the x-axis. Any insight? Happy to send a test file if necessary.

Hi @veronica_zappp 

Yes, please share a test file.

You have to share the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

@AlB

 

Worked like a charm! Thank you so much Smiley Happy

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.

Top Solution Authors