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
Anonymous
Not applicable

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
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi,

 

I have a similar problem with one field only. When applying a filter to that field I want the result to always show one of the options, as well as the selected option.

 

The field options are as below:

 

Deal Stage 1

Deal Stage 2

Deal Stage 3

Deal Stage 4

Deal Stage 5

(Blank)

 

When a user selects a certain deal stage I want all values with a (Blank) to also remain in the result. It also needs to be possible to multi-select stages and still include (Blank) in the result.

 

I'm very new to DAX and any help with this is greatly appreciated!

 

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.