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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Dunner2020
Post Prodigy
Post Prodigy

Creating a new column using parameter list of values in power query

Hi there,

 

I got a table which contains the name of the staff. I want to create a new column that contains either 0 or 1. 1 means staff is from the active list and 0 means staff is not. To create a new column, I first created a text parameter that has a list of values. I entered the name of all active staff names into the parameter and set one staff name as the current value.  

 

I created a conditional column and change the operator from equal to contains and select the parameter name in the value as shown in the figure:

Dunner2020_0-1642557617668.png

The problem is that it only returns 1 when the staff name matches to the current value of the parameter. It does not return the 1 for other staff name present in the parameter list. Could anyone guide me where I am making the mistake?

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

Hi, @Dunner2020 

It is not suitable to use parameters here, it is recommended to use ‘list’.

Sample data:

1.png

2.png

Step1:add a custom column to convert the table2 to a list

3.png

Step2: You can use the function 'List.combine' to determine if the row value  exists in the list

4.png

You can also consider creating a calculated column:

Result_Dax = 
var tab=CALCULATE (
    COUNTROWS ( Table2 ),
    FILTER (
        Table2,
        Table2[Registeration Officers] = EARLIER ( Table1[Case Owner] )
    )
)
return IF(tab>=1,1,0)

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Dunner2020 

It is not suitable to use parameters here, it is recommended to use ‘list’.

Sample data:

1.png

2.png

Step1:add a custom column to convert the table2 to a list

3.png

Step2: You can use the function 'List.combine' to determine if the row value  exists in the list

4.png

You can also consider creating a calculated column:

Result_Dax = 
var tab=CALCULATE (
    COUNTROWS ( Table2 ),
    FILTER (
        Table2,
        Table2[Registeration Officers] = EARLIER ( Table1[Case Owner] )
    )
)
return IF(tab>=1,1,0)

Please check my sample file for more details.

 

Best Regards,
Community Support Team _ Eason

sevenhills
Super User
Super User

Just curious why you did not try this approach

a) Create a table of values , "Enter Data" and have the columns as "Name", "Active".
         Values for active is 1 or 0. .

b) Merge the two tables and get the value for matching ones and the active status

c) Optional: Replace all status those are nulls as zero

Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.