Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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...
  • v-lili6-msft's avatar
    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