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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Manually enter or filter a value to change a column/filter

I have a list of employee IDs. I have a column of Active or Inactive that comes from the source system. I have a line chart that shows the hours they have worked over the last two years. In that line chart, I exclude the last 90 days before departure date of every Inactive employee.

 

I need to be able to enter an employee ID (filter, slicer, text search - I don't care as long as the end user can do it in the report) that will switch that employee from Active to Inactive in order to add them to the Inactive filter. That is, if we know someone is about to leave but they are not actually marked Inactive in the source system, I want to manually mark them as Inactive in the report.

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

Due yo I don't know your data model, I build a sample table to have a test.

1.png

Build an ID Table with distinct ID value to build a Slicer.

 

ID = VALUES('Table'[EmployID])

 

You can change the type of ID to Text, and then you can do Search in Slicer.

2.png

Build a Measure to achieve your goal.

 

Dynamic Status = 
VAR _Select =
    ALLSELECTED ( 'ID'[EmployID] )
RETURN
    IF (
        ISFILTERED ( 'ID'[EmployID] ),
        IF (
            MAX ( 'Table'[Status] ) = "Active"
                && MAX ( 'Table'[EmployID] ) IN _Select,
            "Inactive",
            MAX ( 'Table'[Status] )
        ),
        MAX ( 'Table'[Status] )
    )

 

Result is as below.

In Default, the measure will show the same as the values in Status column.

3.png

Select one or multipy IDs in Slicer.(Ctrl+Left click) Here I select 001 and 010, they all show "Inactive".

4.png

You can download the pbix file from this link: Manually enter or filter a value to change a column/filter

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

7 REPLIES 7
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

Due yo I don't know your data model, I build a sample table to have a test.

1.png

Build an ID Table with distinct ID value to build a Slicer.

 

ID = VALUES('Table'[EmployID])

 

You can change the type of ID to Text, and then you can do Search in Slicer.

2.png

Build a Measure to achieve your goal.

 

Dynamic Status = 
VAR _Select =
    ALLSELECTED ( 'ID'[EmployID] )
RETURN
    IF (
        ISFILTERED ( 'ID'[EmployID] ),
        IF (
            MAX ( 'Table'[Status] ) = "Active"
                && MAX ( 'Table'[EmployID] ) IN _Select,
            "Inactive",
            MAX ( 'Table'[Status] )
        ),
        MAX ( 'Table'[Status] )
    )

 

Result is as below.

In Default, the measure will show the same as the values in Status column.

3.png

Select one or multipy IDs in Slicer.(Ctrl+Left click) Here I select 001 and 010, they all show "Inactive".

4.png

You can download the pbix file from this link: Manually enter or filter a value to change a column/filter

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Greg_Deckler
Super User
Super User

@Anonymous - Perhaps you could use a What If parameter?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler I tried that, since my employee IDs are numbers. But the parameter only goes up to 99999 (5 digits) and I need 7. I don't understand why it has a cap, but unless there's some trick to get around that, it won't work.

@Anonymous - OK, then just create a separate, disconnected table for your employee ids.

Employees = DISTINCT(SELECTCOLUMNS('Table',"EmployeeID",[EmployeeID]))

Something like that. Then you can use this as your "what if" parameter slicer. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Can you break down what to do with that table? I don't know how to set it up so an end user can enter an Employee ID and it will switch from Active to Inactive in my formula.

@Anonymous - I don't have your formula or really much detail about what you are doing so it is kind of tough to be specific. But, if you have a disconnected table, you can do something like the following:

Measure =
  VAR __EmployeeID = MAX('Table'[EmployeeID])
  VAR __Table = SELECTCOLUMNS('Slicer Table',"Selections",[Column])
RETURN
  IF(__EmployeeID IN __Table,"Inactive","Active")

Again, this is just an example since I literally have no idea about what you are doing. Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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