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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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