Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
Date | Year | ID | Placing | Ranking | Job ID |
2022-07-21 | 2022 | 1 | Ready | Talent | 3 |
2022-07-22 | 2022 | 2 | Ready | Talent | 3 |
2022-07-23 | 2022 | 3 | Good | Star | 1 |
2021-06-22 | 2021 | 1 | Ready | Talent | 2 |
2021-06-23 | 2021 | 2 | Ready | Talent | 3 |
2021-06-24 | 2021 | 3 | Good | Future star | 1 |
2019-06-21 | 2019 | 1 | Good | Star | 2 |
2019-06-22 | 2019 | 2 | Ready | Talent | 3 |
2019-06-23 | 2019 | 3 | Good | Future star | 1 |
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.
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.
Best Regards
@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
User | Count |
---|---|
73 | |
70 | |
38 | |
24 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
41 | |
40 |