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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to filter ID;s based on another column

Hi, I have a table where there is ID, previoustasks_ttaskids and employee_ttaskresourceid columns. I need to filter the table to contain only the ID's where previoustask_ttaskid = id and display the employee_ttaskresourceid. Could someone please help on this.

 

vuolleh_0-1656324789686.png

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = LOOKUPVALUE('refResourceTask (2)'[employee_ttaskresourceid],'refResourceTask (2)'[id],'refResourceTask (2)'[previoustasks_ttaskids])

Hope this helps.

Untitled.png


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

View solution in original post

10 REPLIES 10
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = LOOKUPVALUE('refResourceTask (2)'[employee_ttaskresourceid],'refResourceTask (2)'[id],'refResourceTask (2)'[previoustasks_ttaskids])

Hope this helps.

Untitled.png


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

Hi @Anonymous 

I've created a measure to achieve this.

Matching Id's = COUNTROWS(FILTER('Ids','Ids'[PreviousTaskId] = 'Ids'[Id]))

Table:

NVIDIA_Share_NsV4DZbgSb.png

 

 

 

 

Result:

NVIDIA_Share_jgAvjdU5ye.png

 

Kind regards,
Seanan
If this post helped, please consider accepting it as the solution.

Anonymous
Not applicable

Hi @Seanan for some reason I can't get any results from the measure

vuolleh_0-1656327664593.png

 

Hi @Anonymous 

It appears you've created this as a calculated column. Could you please create this as a measure and then you can use it in a table visualisation.

Anonymous
Not applicable

Hi @Seanan It seems that the end result  is the same when using it to measure. Might have something to do with blank spaces 🤔

vuolleh_0-1656330102035.png

 

Hi @Anonymous 

Would you be able to send the PBIX without any sensitive data so I can take a look?

Anonymous
Not applicable

Hi @Anonymous 

I've found the issue as to why the measure is returning 0 rows. In the dataset non of the previousId's are matching the Id column. For example, the measure will check row 10 of the previousId column and see if row 10 in the Id column is a match. This means that it is not looking for row 10 of previousId across the entire Id column. 

 

Is the expected result to look for a previousid across the entire Id column?

Anonymous
Not applicable

Hi @Seanan . These ID:s actually describes employee positions. Id is the position id, previous task id's are telling that is a superior for the  particular position etc. So there is a superior-employee hierargy represented and the employee_ttaskresourceid is the person who holds the position

 

This is a bit tricky as this hierargy is not represented in any other form. For example nowhere in the db there is no clear indicator who is a superior and who is not and I need to report employee work leaves by the superior etc.

 

here is a sample pic from dev. environment what this data represents

vuolleh_0-1656391492802.png

 

Anonymous
Not applicable

@Seanan Hi, and thanks for your effort to help with this case. Ashis provided workable suggestion and I resolved the case.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors