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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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