Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Yogisha
Frequent Visitor

Ignore filtering for one value in slicer

Hello,

 

I have a requirement where I need to ignore the filter for one value in the slicer.

For example, the slicer contains values like A, B, C, when the user selects A then all values should be shown in the table visual. It should ignore filtering for A and should show all values A, B, and C in visual.

But when the user selects B or C then only either B or C should be shown in the visual.

 

Yogisha_0-1613119373809.png

 Here expected result will be 

Yogisha_1-1613119410308.png

 

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
lkalawski
Memorable Member
Memorable Member

Hi @Yogisha 

You need to create additional table with no relationships. It will be dictionary for slicer values. And then create a measure with SWITCH function to add an action for each of the selection. 

Table:

lkalawski_0-1613120215390.png

 

New table: 

 

Table 2 = SELECTCOLUMNS('Table', "Slicer", 'Table'[Column1])

 

Measure:

 

Selected Value = 
VAR __SelectedValue = SELECTEDVALUE('Table 2'[Slicer])

RETURN 
SWITCH(__SelectedValue,
"A", SUM('Table'[Column2]),
CALCULATE(SUM('Table'[Column2]), FILTER('Table', 'Table'[Column1] = __SelectedValue))
)

 

The result:

lkalawski_0-1613120377764.pnglkalawski_2-1613120249615.png

 

 

Please check the .pbix file.

 

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

View solution in original post

2 REPLIES 2
lkalawski
Memorable Member
Memorable Member

Hi @Yogisha 

You need to create additional table with no relationships. It will be dictionary for slicer values. And then create a measure with SWITCH function to add an action for each of the selection. 

Table:

lkalawski_0-1613120215390.png

 

New table: 

 

Table 2 = SELECTCOLUMNS('Table', "Slicer", 'Table'[Column1])

 

Measure:

 

Selected Value = 
VAR __SelectedValue = SELECTEDVALUE('Table 2'[Slicer])

RETURN 
SWITCH(__SelectedValue,
"A", SUM('Table'[Column2]),
CALCULATE(SUM('Table'[Column2]), FILTER('Table', 'Table'[Column1] = __SelectedValue))
)

 

The result:

lkalawski_0-1613120377764.pnglkalawski_2-1613120249615.png

 

 

Please check the .pbix file.

 

 

PBI_SuperUser_Rank@1x.png Proud to be a Super User.
If I helped, please accept the solution and give kudos
Linkedin

 

Thank you..It worked like a champ!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.