Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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:
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?
Solved! Go to Solution.
Hi, @Dunner2020
It is not suitable to use parameters here, it is recommended to use ‘list’.
Sample data:
Step1:add a custom column to convert the table2 to a list
Step2: You can use the function 'List.combine' to determine if the row value exists in the list
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
Hi, @Dunner2020
It is not suitable to use parameters here, it is recommended to use ‘list’.
Sample data:
Step1:add a custom column to convert the table2 to a list
Step2: You can use the function 'List.combine' to determine if the row value exists in the list
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
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
218 | |
88 | |
83 | |
65 | |
56 |