Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Everyone knows how to create a table of distinct values from multiple columns but how about creating a table based on the distinct values of a single column?
The below formula creates a distinct table as needed but if an eventID had multiple regions it will still create multiple rows of the same eventID.
How do I change the DAX so that no matter what the eventID can only be pulled once (FIRST)?
NewTable = distinct(SELECTCOLUMNS('MyTable',"eventID",'MyTable'[eventID],"Region",'MyTable'[Region]))
Solved! Go to Solution.
I tested this. This should works. Could you please provide screenshot or sample data?
Table = SUMMARIZE(Mytable,Mytable[eventid],"region",min(Mytable[region]))
Proud to be a Super User!
@WorkHard , Try like
NewTable =summarize('MyTable','MyTable'[Region],"eventID" ,min('MyTable'[eventID]))
or //when you min region
NewTable =summarize('MyTable','MyTable'[eventID],"Region" ,min('MyTable'[Region]))
the min() method gives me a "Parameter is not the correct type". Both columns are type string.
I tested this. This should works. Could you please provide screenshot or sample data?
Table = SUMMARIZE(Mytable,Mytable[eventid],"region",min(Mytable[region]))
Proud to be a Super User!
have you tried summarized?
table = summarized('MyTable',"eventID",'MyTable'[eventID],"Region",'MyTable'[Region])
Proud to be a Super User!
Yes, summarize does the same thing, it will still duplicate the event ID.
User | Count |
---|---|
102 | |
90 | |
80 | |
71 | |
70 |
User | Count |
---|---|
114 | |
100 | |
97 | |
72 | |
71 |