cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PBNikr Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

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

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

 

 

 

2 REPLIES 2
Super User
Super User

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

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

 

 

 

PBNikr Frequent Visitor
Frequent Visitor

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

@AlB

 

Worked like a charm! Thank you so much Smiley Happy