Forum Discussion
Min value with duplicate unique IDs
Hello,
I have two data sources. My main data source does not have duplicate case numbers. My other data source does have duplicate case numbers. I wanted to pull the minimum value from my data source that has duplicates values to my main data sources.
Below is my duplicate data source. Ex: i want to take HR Case ID 1002 and bring the min value of 1 into my main data source by HR Case ID.
| HR CASE ID | Conclusion |
| 1002 | 3 |
| 1002 | 2 |
| 1002 | 1 |
| 1003 | 2 |
| 1003 | 3 |
| 1004 | 1 |
| 1004 | 2 |
| 1004 | 3 |
| 1004 | 4 |
- Anonymous4 years ago
Hi mmills2018,
What type of calculating expressions are you wanted? Measure or calculated column? Please check the below formulas if they help:
Measure:
Measure = CALCULATE ( MIN ( Table[Conclusion] ), VALUES ( Table[HR CASE ID] ) )Calculated column:
Column = MINX ( FILTER ( Table, [HR CASE ID] = EARLIER ( Table[HR CASE ID] ) ), Table[Conclusion] )Regards,
Xiaoxin Sheng
2 Replies
- parry2kSuper User
mmills2018 add a column in your main table:
Column = VAR __table = RELATEDTABLE ( "DuplicateValueTable" ) RETURN MINX ( __table, [Conclusion] )assuming these two tables have a relationship on Case ID which will be one to many.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- AnonymousNot applicable
Hi mmills2018,
What type of calculating expressions are you wanted? Measure or calculated column? Please check the below formulas if they help:
Measure:
Measure = CALCULATE ( MIN ( Table[Conclusion] ), VALUES ( Table[HR CASE ID] ) )Calculated column:
Column = MINX ( FILTER ( Table, [HR CASE ID] = EARLIER ( Table[HR CASE ID] ) ), Table[Conclusion] )Regards,
Xiaoxin Sheng