Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
On my dataset I have a column colled profile_name, take a look above:
profile_name | reviewed_at | product |
Stefane | 24/03/2015 | Iphone XR |
John | 24/03/2015 | Iphone XR |
John | 24/03/2015 | Iphone XR |
So as you can see John appears two times, and on my dataset doesn't contains a column to unique identify this person. It's more than three rows. So, how can I create this column with ID but unique for each person? Like the exemple bellow:
UNIQUE_ID | profile_name | reviewed_at | product |
1442 | Stefane | 24/03/2015 | Iphone XR |
253 | John | 24/03/2015 | Iphone XR |
253 | John | 24/03/2015 | Iphone XR |
I'd say you're in trouble if you're having to generate unique ids from within PowerBI. The problem with using RANKX is that the ranking is going to change as your data expands over time, so it's not really a UID (assuming you're not working with a one off static dataset). If you have a new user called Andrew added to your table in future they would become #1. You might be better off assigning UIDs to profiles in a separate lookup table (e.g. in excel). You also have the issue that profile name is not unique - what happens if you have profiles for two seperate Johns?
@Junaid11 Thank you for the help, but I could not solfe my problem ☹️ I got an error saing that:
MdxScript(Model) (3, 112) Calculation error in measure 'FACT_ALL_REVIEWS'[unique_id]: The 'RANKX' function does not support comparing values of type Text with values of type Number. Consider using the VALUE or FORMAT function to convert one of the values.
When trying to do this:
I don't know if it's important, but I created as a calculated measure. Not on the transformation center using the "create personalized column"
Hello @marzuca ,
You can use below code to generate it.
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |