cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PBNikr Regular Visitor
Regular 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
Highlighted
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] )
)

 

 

 

View solution in original post

2 REPLIES 2
Highlighted
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] )
)

 

 

 

View solution in original post

PBNikr Regular Visitor
Regular 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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 103 members 1,419 guests
Please welcome our newest community members: