Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Everyone,
My dataset looks like:
Date | Product |
1/1/2022 | Table |
1/1/2022 | Chair |
1/1/2022 | Seat |
1/1/2022 | Monitor |
1/1/2022 | Monitor |
1/1/2022 | PC |
1/1/2022 | Laptop |
1/2/2022 | Table |
1/2/2022 | Chair |
1/2/2022 | Seat |
1/2/2022 | Monitor |
1/2/2022 | Laptop |
1/2/2022 | Laptop |
1/2/2022 | Table |
1/2/2022 | Chair |
I would like to add a 3rd column where occurence of product is counted. The output would look like:
Date | Product | Occurence |
1/1/2022 | Table | 1st |
1/1/2022 | Chair | 1st |
1/1/2022 | Seat | 1st |
1/1/2022 | Monitor | 1st |
1/1/2022 | Monitor | 2nd |
1/1/2022 | PC | 1st |
1/1/2022 | Laptop | 2nd |
1/2/2022 | Table | 2nd |
1/2/2022 | Chair | 2nd |
1/2/2022 | Seat | 2nd |
1/2/2022 | Monitor | 2nd |
1/2/2022 | Laptop | 3rd |
1/2/2022 | Laptop | 4th |
1/2/2022 | Table | 3rd |
1/2/2022 | Chair | 3rd |
How do I achieve this in dax?
Thanks!
Solved! Go to Solution.
@adityamalik1234 , You can create a Rank Column
A new column = rankx(filter(Table, [Product] =earlier([Product]) ), [Date],,asc,dense)
You can append text in a new column as per need
@adityamalik1234 , You can create a Rank Column
A new column = rankx(filter(Table, [Product] =earlier([Product]) ), [Date],,asc,dense)
You can append text in a new column as per need
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |