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 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
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 |
---|---|
95 | |
94 | |
79 | |
71 | |
64 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |