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
cw900
Helper I
Helper I

How do I create a list of values based on a slicer selection, so I can then populate a table?

I have a list of groups and a list of rules based on job title. The rules don't always follow the same format so I can't just join the two tables in the model and select from the slicer to fill the table.

 

The end results is that I want to select a an Employee Grouping in a slicer and display the employees in a table. I'd be happy to create some list of nested if statements and iterate through each rule or similar but I don't know where I would evaluate that list of nested if statements.

 

These are the two tables of data I'm working with:

 

Employee GroupingRule
LeadershipJobTitle = "Leadership"
ManagersJobTitle = "Manager"
Factory StaffJobTitle = "Factory"
Admin StaffJobTitle IS LIKE "Admin"
Temp StaffJobTitle IN ("Temp Office", "Temp Factory")

 

 

Employee IDEmployee NameEmployee JobTitle
2340SarahLeadership
2342BobLeadership
3456JaniceTemp Factory
4564JaneFactory
5727SteveAdmin Assistant
2457LindaFactory
3453PeteTemp Office
2341ScottFactory
7456TomFactory
6456GillAdmin Lead
2635BertManager
2178TracyManager
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @cw900 

 

You can try the following methods.

Column:

Employee Grouping = 
SWITCH(TRUE(),
[Employee JobTitle]="Leadership","Leadership",
[Employee JobTitle]="Manager","Managers",
[Employee JobTitle]="Factory","Factory Staff",
SEARCH("Admin",[Employee JobTitle],,BLANK())<>BLANK(),"Admin Staff",
[Employee JobTitle] in {"Temp Office", "Temp Factory"},"Temp Staff")

vzhangti_0-1700016423721.pngvzhangti_1-1700016456578.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @cw900 

 

You can try the following methods.

Column:

Employee Grouping = 
SWITCH(TRUE(),
[Employee JobTitle]="Leadership","Leadership",
[Employee JobTitle]="Manager","Managers",
[Employee JobTitle]="Factory","Factory Staff",
SEARCH("Admin",[Employee JobTitle],,BLANK())<>BLANK(),"Admin Staff",
[Employee JobTitle] in {"Temp Office", "Temp Factory"},"Temp Staff")

vzhangti_0-1700016423721.pngvzhangti_1-1700016456578.png

Is this the result you expect? Please see the attached document.

 

Best Regards,

Community Support Team _Charlotte

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

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula

Column = if(SEARCH("admin",Data[Employee JobTitle],,BLANK()),"Admin",if(SEARCH("temp",Data[Employee JobTitle],,BLANK()),"Temp",Data[Employee JobTitle]))

Hope this helps.

Ashish_Mathur_0-1699918689381.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.