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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ElloPBI
New Member

How to detect and count same values for same ID different years

Hello!

 

 I need some help how to identify same values for same ID in different years. 

I could merge user ID's and values from different year -tables in query editor as a new table, but I would like to have a measure so I can  select if I want to look one or two years behind. 

Let's say this is my appended table: 

DateYearIDPlacingRankingJob ID
2022-07-2120221ReadyTalent3
2022-07-2220222ReadyTalent3
2022-07-2320223GoodStar1
2021-06-2220211ReadyTalent2
2021-06-2320212ReadyTalent3
2021-06-2420213GoodFuture star1
2019-06-2120191GoodStar2
2019-06-2220192ReadyTalent3
2019-06-2320193GoodFuture star1



I would like to count how many ID's have the same value in e.g. placing if I compare 2022 to 2019 (two years back from current year) and for those who have same placing, how many of them have same ranking and job, but don't know how to do it. Can someone help me? 


Thank you in advance. 

2 REPLIES 2
Anonymous
Not applicable

Hi @ElloPBI ,

What's your expected result? Do you want to get the count of ID which have the same Ranking and Job ID from 2022 back to 2019?  And according to your provide data,  if there is only the ID 2 meet all the conditions? Could you please provide more sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

yingyinr_0-1658735623450.png

Best Regards

amitchandak
Super User
Super User

@ElloPBI , You have create Two measure and compare

 

 

T1= calculate(max(Table[Ranking]), filter(table, Table[year] =2022))

 

T2= calculate(max(Table[Ranking]), filter(table, Table[year] =2019))

 

countx(Values(Table[ID], if([T1] =[T2] , [ID] , blank() ) )

 

If you need select two years in slicer refer

 

How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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