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 Team,
I have a question looks pretty simple, but not able to have a crack at it.
I have two columns Emp ID and Manager ID.
I need a measure to get 1 when the emp ID is also listed in ManagerID.
I tried this measure :
is manager? = if(contains(table, table[mgrID],"xyz"),1,0)
But this gives "1" next to the employees where the xyz is a manager for them.
I need to get in the below format.
Current results with above formula. | ||
Emp Id | Mgr ID | is Manager? |
xyz | eef | 0 |
abc1 | xyz | 1 |
abc2 | xyz | 1 |
I need : | ||
EmpID | Mgr ID | is Manager? |
xyz | eef | 1 |
abc1 | xyz | 0 |
abc2 | xyz | 0 |
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,
Yuna
Hi @Anonymous ,
Based on your description, You can create a measure as follows.
Measure_for_IsManager = IF(MAX([EmpID]) in DISTINCT(ALL('1 else 0_Test'[Mgr ID])),1,0)
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous Hi Thanks for the response. This works perfectly fine when i have the filter in the same report. However, the filter is actually not from the same report in my situation. I have a another report and provided link to this report from where the EmpID filter value flows.
The selectedvalue() captures the empid. But its not passing it to the if condition below
is manager = if(contains(table, table[managerid], selectedvalue(empid)),1,0)
How do I make it happen?
Hi @Anonymous ,
Maybe I'm not getting what actually you are trying to do. Do you mean that EmpId is on another table in the same report? If the data (or fields) are not in the same report, DAX functions or M queries are disable to be used.
Could you please share some sample data and the expected result to have a clear understanding of your question? I can do some tests for you. Some screenshots are welcome.
Best Regards,
Yuna
@Anonymous , Try a new column
is Manager =
if(countx(filter(Table, [EmpID] =earlier([Mgr ID])),[Mgr ID])+0 >1,1,0)
I cant have a new column as there is a restriction from my company so i need a measure. Would it be possible?
@Anonymous , Try this one, I tested this
Measure 2 = if(countx(filter(allselected('Table'), max([Emp ID]) =([Mgr ID])),[Mgr ID])+0 >1,1,0)
@amitchandak Hi again, this formula says "too few arguments passed to the filter function
@Anonymous , Not tested yet, something like this
if(countx(filter(allselected(Table), [EmpID] =max([Mgr ID])),[Mgr ID])+0 >1,1,0)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
123 | |
78 | |
48 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |