Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Summarize with distinct values

Hello everyone!

 

I have a table that i created using summarize:

SUMMARIZE('table, 'table'[ID], 'table'[age], 'table'[description])
 
But there is repeated rows because the "age"
For exemple:
IDAgeDescription

1

10aaa
111aaa
312bbb
312bbb

 

I need create a summarize with disticnt values, if its possible, but i dont know to do it.

 

Exemple of output:

IDAgeDescription1
111aaa
312bbb

 

Doesnt matter wich age wil be print (10 or 11), i just need one ID on my table.

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hello @henriquemalone ,

Create a column as shown below:

Column = 
var _previousid=CALCULATE(MAX('Table'[ID]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[Age]<EARLIER('Table'[Age])))
Return
IF(_previousid=BLANK(),'Table'[Description],BLANK())

Next, you'll see:

Screenshot 2020-10-05 162329.png

For the related .pbix file, see attachment pls.

Saludos
Kelly

Have I answered your question? Mark my position as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hello @henriquemalone ,

Create a column as shown below:

Column = 
var _previousid=CALCULATE(MAX('Table'[ID]),FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[Age]<EARLIER('Table'[Age])))
Return
IF(_previousid=BLANK(),'Table'[Description],BLANK())

Next, you'll see:

Screenshot 2020-10-05 162329.png

For the related .pbix file, see attachment pls.

Saludos
Kelly

Have I answered your question? Mark my position as a solution!

negi007
Community Champion
Community Champion

@Anonymous  Open your data in power query window and there you can remove duplicate values like below. right click on the ID column and select remove duplicates

 

Disinct VAlue.png

 

or directly use below code 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI0ABKJiYlKsTpQAUMkAWOQgBGQSEpKwiIQCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Age = _t, Description = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Age", Int64.Type}, {"Description", type text}}),
#"Removed Duplicates1" = Table.Distinct(#"Changed Type", {"ID"})
in
#"Removed Duplicates1"




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

PaulDBrown
Community Champion
Community Champion

@Anonymous 

Are you creating a dimension table for IDs?

If so, create a new table using VALUES(table[id])
then create a relationship between this dimension table and your fact table by linking the id fields. Use the dimension Id in your visuals. 
However, beware that if you include the age column the id = 1 will be repeated since there are 2 age values for this id. If you want to avoid this, create a measure to find the MAX value for age and use that measure instead of the column in the visual





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.