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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Saloni_Gupta
Helper I
Helper I

Keep Filter on 2 values of a column and allow user to select from other values

Hi All,

I have a requirement where I want to keep 2 values of a column to be always selected and allow other values to be selected by the user in a slicer.
For e.g. The values "Firm" and "Global" in the slicer "Group" should always be displayed (irrespective of user's selection ) and allow them to select other values from the list.

Saloni_Gupta_0-1686598404500.png

 

I tried using DAX in a column

1. Keep Firm Global Filter = CALCULATE(VALUES('GPS_Data'[Group]),KEEPFILTERS(GPS_Data[Group]= "Firm" || (GPS_Data[Group])= "Global"))
but it does not give me other values than Firm and Global.
another way
2. FY23 Keep Firm Global Filter =
var _grpvalues = VALUES('GPS_Data'[Group])
RETURN
CALCULATESUM(GPS_Data[FY23]), ALL('GPS_Data'[Group]), 'GPS_Data'[Group] in _grpvalues || 'GPS_Data'[Group] = "Firm" || 'GPS_Data'[Group] = "Global")
But with this, If I select any Group value, it will add Firm and Global values to the selected value bar which is again not correct as I always want to display "Firm and "Global" bars.
 
Can you please help me correct the DAX or let me know if there is any other way (by another table).

Thanks in Advance!
1 ACCEPTED SOLUTION
Saloni_Gupta
Helper I
Helper I

@amitchandak ,

Thanks Amit, I resolved it by creating a seperate table where I have values in the below format and joined it with the main table and then using the newly created Group values in the slicer.

Saloni_Gupta_0-1686767476779.png

 

View solution in original post

2 REPLIES 2
Saloni_Gupta
Helper I
Helper I

@amitchandak ,

Thanks Amit, I resolved it by creating a seperate table where I have values in the below format and joined it with the main table and then using the newly created Group values in the slicer.

Saloni_Gupta_0-1686767476779.png

 

amitchandak
Super User
Super User

@Saloni_Gupta , have this slicer on an independent table

 

FY23 Keep Firm Global Filter =
var _grpvalues = VALUES('GPS_DataInd'[Group])
RETURN
CALCULATE( SUM(GPS_Data[FY23]), ALL('GPS_Data'[Group]), 'GPS_Data'[Group] in _grpvalues || 'GPS_Data'[Group] = "Firm" || 'GPS_Data'[Group] = "Global")

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.