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.
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.
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 |
---|---|
106 | |
98 | |
75 | |
63 | |
62 |
User | Count |
---|---|
139 | |
104 | |
104 | |
80 | |
66 |