How to use unique?

I have a “company” column in a table.
In the column there are several rows as the name of the same company.
I would like to create a UX where only show the name of these companies once.

I tried

unique(list (table [company]))

in the slice.

DOES NOT WORK

Any tips?

Solved Solved
0 6 307
1 ACCEPTED SOLUTION

I wouldn’t recommend using RowNumber as it may not reflect the true chronological order of the rows. Use a time stamp instead and define a yes/no VC in your table like this:

[Timestamp] = MAX(SELECT (Table [Timestamp], [Company]= [_THISROW]. [Conpany]))

Then you can display rows based on that VC being TRUE.

View solution in original post

6 REPLIES 6

By using list you are creating a list of list. Remove the list in your formula.

I did not understand. Can exemplify ?

@Bellave_Jayaram
I don’t know if I’m following the right logic.

but what I want is to show only the biggest rownumber of each column company.

I wouldn’t recommend using RowNumber as it may not reflect the true chronological order of the rows. Use a time stamp instead and define a yes/no VC in your table like this:

[Timestamp] = MAX(SELECT (Table [Timestamp], [Company]= [_THISROW]. [Conpany]))

Then you can display rows based on that VC being TRUE.

I think what you want to do is create a slice on you table. The slice will filter the table to only include a single row per company. You don’t so much care which row of a company is included, just that there is exactly one row per company. The slice filter you want is something like this:

([_THISROW] = MAXROW("MyTable", "_ROWNUMBER", ([_THISROW].[Company] = [Company])))

replacing MyTable with the name of the table.

As @Bellave_Jayaram suggests, though, the row numbers may not truly reflect the chronological order in which the rows were added (for instance, if you’ve manually sorted the worksheet, or of you’re using a database rather than a spreadsheet). If you specifically want the newest row and the table has some sort of timestamp column that can identify the newest row, you would do well to use the timestamp rather than the row number:

([_THISROW] = MAXROW("MyTable", "Timestamp", ([_THISROW].[Company] = [Company])))

replacing Timestamp with the name of your timestamp column.

Thank you very much.

I followed these tips

I managed to reach my goal.

@Steve and @Bellave_Jayaram You are champions

Top Labels in this Space