How do I avoid duplicate values for a column in a specific data slice?
Iโm sure this should be simple but I cannot find how to do it! I have a table โTenancy Applicationโ with multiple columns but the significant columns for this query are [TenancyAppID], [Tenant] and [TenancyYear].
I want a data slice that includes all columns but only displays a single occurrence of [Tenant] values. Reason being a [Tenant] could occur on one or more row due to having different [TenancyYear] value.
What do I need to add to following filter expression to achieve this?
ISNOTBLANK([Tenant])
(It would also be a bonus if I could sort the records alphabetically at the same time, although I appreciate that I can do this with my selected views)
Soโฆ are you saying that you want to filter duplicate records away with the slice. You only want to show one record from that โgroupโ?
@Aleksi_Alkio Yes, basically using it to display list of tenantsโ information and do not want the same tenant to appear twice.
Youโre welcome
You would need to add a virtual columnโฆ for example with the MAXROW expression and then filter the data with a formula like [KeyColumn]=[MaxRowColumn]
Thanks Aleksi, Iโll give it a try
Another way could be a simple formula in initial value when you add a new record. It could be like IFS(NOT(IN([Tenant],TableName[Tenant])),1) and then you can filter it with the simple condition like [TestColumn]=1. This will work if you never delete any record from that table. The good thing is that you donโt need to calculate the MAXROW value every time when you sync the app.
Iโve tried to create virtual column using
MAXROW(โTenancy Applicationโ,[TenancyAppID])
but expression builder states
โFunction โMAXROWโ should have at least two parameters: a table name, a column name, and an optional filter expressionโ
Try with MAXROW(Tenancy Application,TenancyAppID).
Appears that I am unable to use MAXROW as this returns
โThe inputs for function โMAXโ should be a list of numeric valuesโ
My key column [TenancyAppID] is a UNIQUEID() value. Sadly cannot implement your other suggestion as working with live data that has already been entered.
Guess I may have to give up on this idea as already spent loads of time trying to figure out how to do it.
Try with MAXROW(Tenancy Application,_rownumber,[TenancyAppID]=[_THISROW].[TenancyAppID])
That one didnโt work, but managed to get it to work by using the following expressions
For virtual column MAXROW(Tenancy Application, _rownumber, [Tenant]=[_THISROW].[Tenant])
For slice filter
[TenancyAppID]=[_DuplicatesFilter]
Thanks for sticking with me on this, definitely wouldnโt have got there without your help. Once again, great support!
if for a duplicate number format can you use this formula
User | Count |
---|---|
14 | |
11 | |
9 | |
7 | |
4 |