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
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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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