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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.