Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

First occurrence value display in table visual

Hi Community..!!
I need to create a table visual which consist of 1st occurrence of each product. Please refer the below sample data.

Product 

category 

price 

P1 

c1 

10 

p2 

c2 

20 

p3 

c3 

30 

P1 

c4 

40 

p2 

c5 

50 

p3 

c6 

60 

p4 

c7 

70 

 

How can I achieve this?

  • Anonymous , Try a measure like the one below with the above fields. Add an index column in the power query first

     

    calculate(max(Table[Price]), filter(Table, Table[Index] = minx(filter(allselected(Table), Table[Product] = max(Table[Product])), Table[Index])))

4 Replies

  • Hello Anonymous ,

     

    Do we have date/time field in data?

    How to identify which record is first?

     

    Thanks.

    Shishir

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Shishir22 
      No such column to identify which is the first record.

  • Anonymous , Try a measure like the one below with the above fields. Add an index column in the power query first

     

    calculate(max(Table[Price]), filter(Table, Table[Index] = minx(filter(allselected(Table), Table[Product] = max(Table[Product])), Table[Index])))