Forum Discussion
Anonymous
5 years agoNot applicable
Display only first column value in a table with duplicate values
Good day! I am trying to figure out how to show only the first value of the column. I have a table that contains duplicate values for InvoiceID and InvoiceAmount for each productID. I want to kee...
- 5 years ago
hi Anonymous
If you want to create a measure, just try this measure
Measrue = var _firstrow=CALCULATE(MIN('Table'[productID]),ALLEXCEPT('Table','Table'[InvoiceID],'Table'[InvoiceAmount])) return CALCULATE(MIN('Table'[InvoiceAmount]),FILTER('Table','Table'[productID]=_firstrow))Result:
and here is sample pbix file, please try it.
Regards,
Lin
Anonymous
5 years agoNot applicable
Thank you for the quick reply amitchandak
I checked the suggested measures and both of them returned the same InvoiceAmount for each row:
| InvoiceID | productID | Measure | Measure 3 | InvoiceAmount |
| A0246605 | item0010 | 999999 | 999999 | 999999 |
| A0246605 | Item0079 | 999999 | 999999 | 999999 |
| A0246605 | Item0081 | 999999 | 999999 | 999999 |
| A0246605 | Item0093 | 999999 | 999999 | 999999 |
| A0246605 | Item0166 | 999999 | 999999 | 999999 |
| A0246605 | Item0191 | 999999 | 999999 | 999999 |
| A0246605 | Item0102 | 999999 | 999999 | 999999 |
| A0246605 | Item0470 | 999999 | 999999 | 999999 |
| A0246605 | Item0001 | 999999 | 999999 | 999999 |
Measure "Measure" - sumx(values(Table[InvoiceID]), min(Table[InvoiceAmount]))
Measure "Measure 3" - sumx(values(Table[InvoiceID]),Firstnonblankvalue(productID, min(Table[InvoiceAmount])))
Greg_Deckler
5 years agoCommunity Champion
Anonymous Is there something to identify "First" like a date column or Index? Index would be good then it would be easy. Just find the MINX at that point. Basically a Lookup Min/Max. https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434