Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I need your help in a logic. I need 1 in front of every unique count in query editor.
Here is the output which I need.
ID | Result |
3381274 | 1 |
3381433 | 1 |
3381433 | 0 |
3381433 | 0 |
3381503 | 1 |
3381503 | 0 |
3381503 | 0 |
3382201 | 1 |
3382201 | 0 |
3382201 | 0 |
3382251 | 1 |
3382251 | 0 |
3382251 | 0 |
3382289 | 1 |
3382289 | 0 |
3382289 | 0 |
3382334 | 1 |
3382334 | 0 |
3382334 | 0 |
3383040 | 1 |
3383223 | 1 |
3383746 | 1 |
3384391 | 1 |
3384391 | 0 |
3384391 | 0 |
3384547 | 1 |
3384552 | 1 |
3384589 | 1 |
Thanks for your support as always.
Regards
Abhijit Mishra
Solved! Go to Solution.
Hi
1. Add a index column starting 0( You can do this in Query Editor -> Add columns tab -> index column-> from 0)
2. Create Rank_Flag column with the below formula:
Rank_Flag = IF(calculate(COUNTROWS(Table1),(FILTER(Table1, EARLIER(Table1[Index])>=Sheet4[Table1])),Table1[ID]=EARLIER(Table1[ID])) =1,1,0)
This will flag the first occurance of the ID . Hope this helps you.
Thanks
Raj
Hi
1. Add a index column starting 0( You can do this in Query Editor -> Add columns tab -> index column-> from 0)
2. Create Rank_Flag column with the below formula:
Rank_Flag = IF(calculate(COUNTROWS(Table1),(FILTER(Table1, EARLIER(Table1[Index])>=Sheet4[Table1])),Table1[ID]=EARLIER(Table1[ID])) =1,1,0)
This will flag the first occurance of the ID . Hope this helps you.
Thanks
Raj
Hi @Anonymous,
Thanks for your reply.
Is there a way I can do the second step in query editor also.
Regards
Abhijit
DAX measure is much faster and the calculations happens inmemoy. Is there any specific reason why you want to do this Query Editor?
Thanks
Raj
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
97 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |