Reply
Frequent Visitor
Posts: 13
Registered: ‎03-23-2018
Accepted Solution

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? 


Accepted Solutions
Highlighted
AlB Super Contributor
Super Contributor
Posts: 1,193
Registered: ‎11-12-2018

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

[ Edited ]

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


All Replies
Highlighted
AlB Super Contributor
Super Contributor
Posts: 1,193
Registered: ‎11-12-2018

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

[ Edited ]

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

 

 

 

Frequent Visitor
Posts: 13
Registered: ‎03-23-2018

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

[ Edited ]

@AlB

 

Worked like a charm! Thank you so much Smiley Happy