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

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.

Reply
Anonymous
Not applicable

Highest value of duplicate

Hi,

 

i have 3 columns column 1 is unique, column 3 and 4 can have duplicates.

 

Now i need to add a column to identify which has the highest value in column 1 when its a duplicate.

 

Example:

IndexIdName
1A21red
2A21red
3A22green
4A23yellow
5A22green
6A24blue
7A21red
8A22green
9A24blue

 

I need to have the higehst value marked with yes in a caalculated column 4

 

IndexIdNameHighest value
1A21redNo
2A21redNo
3A22greenNo
4A23yellowYes
5A22greenNo
6A24blueNo
7A21redYes
8A22greenYes
9A24blueYes

 

Any idea to solve it? Any help is welcome 🙂

 

Regards

3 REPLIES 3
je_s
New Member

My "index" column is not unique (it's actually a duration column counting stop time) - Is there a way to return one of the vaules? 

example: Wrong

je_s_0-1662116128542.png

 

Example: Correct

je_s_1-1662116161750.png

 

 

 

Hi @je_s ,

You will need some data that will differentiate which value to return if the values match - like the two values of 600.  You can either insert an index column, or I notice that your column has the word time in the header.  You could make a rule of taking the first or the last row based on the date by using the time value.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Nathaniel_C
Super User
Super User

 

Hi @Anonymous ,

Try this:

Highest value = 

var _curName = mycolor[Name]
var _curIndex = mycolor[Index]
var _calc = CALCULATE(MAX(mycolor[Index]),FILTER(ALLEXCEPT(mycolor,mycolor[Name]), mycolor[Name]=_curName))

return IF(_calc = _curIndex, "Yes", "No")

 

mycolor.PNG


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

 





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

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors