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
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
Europe Fabric Conference

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.