March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, i have a table with many variables and it have duplicates, what i want to do is to have count for the variable when it appear the first time and does not count the variable when is appear the second time onwards.
Var | Var | Count | |
A | A | 1 | |
A | A | null | |
B | B | 1 | |
B | B | null | |
C | C | 1 | |
D | D | 1 |
Solved! Go to Solution.
Hi again,
Yes, it is possible please follow these few steps (after adding index column):
1. Group by with counting all rows:
2. Expand only index
3. Add a conditional column
4. remove unnecessary columns
RESULT :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @Yqy
You can achieve it with 2steps :
1 . In PQ add the index column:
2. In the Data editor add a column with this Dax:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi, is it possible to do the second step in Query using M language instead of in the data editor using DAX
Hi again,
Yes, it is possible please follow these few steps (after adding index column):
1. Group by with counting all rows:
2. Expand only index
3. Add a conditional column
4. remove unnecessary columns
RESULT :
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thanks for the help, your solution works.
I was happy to help 😊
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |