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

Advanced Filter to always show one value irrespective of the filter selection

Hi, 

 

I have 2 field which is as below;

Type Value
HP1
HP2
HP3
HP4
HP5
HP6
HP7
HP8
HP9
HP10
AC0
AC0
AC0
AC0
AC0
AC0
AC0

 

I have a slicer for this and I want to always show AC (and its value which is zero always) iresspective of the slicer selection

 

Example: If I select slicer from 5 to 10, I want to show all HP values from 5 to 10 plus all AC rows as well

 

Is there a  DAX code for this or any advance Filter options? Thanks !

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Advanced Filter to always show one value irrespective of the filter selection

Hi @Aby17,

You can take a look at the following steps if they suitable for your requirement.

1, Add an Index Column to show all AC rows at query editor side.

2, Create a calculated table: 

Slicer store = DISTINCT('Type-Value'[Value])

3, Add new measure:

Measure 2 =
IF (
    SELECTEDVALUE ( 'Type-Value'[Type] ) = "AC",
    SUM ( 'Type-Value'[Index] ),
    IF (
        SUM ( 'Type-Value'[Value] ) IN FILTERS ( 'Slicer store'[Value] ),
        SUM ( 'Type-Value'[Index] ),
        BLANK ()
    )
)

1.png

If above doesn't work, share some sample data and expected output will be help.

Best Regards,

Jack

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

1 REPLY 1
Highlighted
Community Support Team
Community Support Team

Re: Advanced Filter to always show one value irrespective of the filter selection

Hi @Aby17,

You can take a look at the following steps if they suitable for your requirement.

1, Add an Index Column to show all AC rows at query editor side.

2, Create a calculated table: 

Slicer store = DISTINCT('Type-Value'[Value])

3, Add new measure:

Measure 2 =
IF (
    SELECTEDVALUE ( 'Type-Value'[Type] ) = "AC",
    SUM ( 'Type-Value'[Index] ),
    IF (
        SUM ( 'Type-Value'[Value] ) IN FILTERS ( 'Slicer store'[Value] ),
        SUM ( 'Type-Value'[Index] ),
        BLANK ()
    )
)

1.png

If above doesn't work, share some sample data and expected output will be help.

Best Regards,

Jack

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)