Forum Discussion
Measure to compare columns
- 8 years ago
Hello,
This wouldn't be a smooth solution.
quentin_vigne: Index is a great idea, but in this case, the two rows would get different index numbers which wasn't my intention.
Maybe you could try the following:
Create a calculated column:
Appearnces= VAR Employee=[Employee]
VAR Date=[Work Date]
VAR ConfID=[Confirmation number]
....
RETURN
COUNTROWS(FILTER(TableName,[Employee]=Employee&&[Work Date]=Date&&[Confirmation number]=ConfID))This measure should give you the number of appearances. Should be either 1 or 2.
Then you can create a reverse filter:
TotalNoDouble=CALCULATE(
SUM([Booked Hours],
FILTER(Table,NOT([Appearances]=2&&[Approval status]="not approved")))Give it a try and let us know.
Best regards
Hello Floriankx,
thanks for your answer! I don´t have a unique identifier. Maybe it is possible to copy all the columns and transform these to one column as a "unique identifier"?
Hello,
This wouldn't be a smooth solution.
quentin_vigne: Index is a great idea, but in this case, the two rows would get different index numbers which wasn't my intention.
Maybe you could try the following:
Create a calculated column:
Appearnces= VAR Employee=[Employee]
VAR Date=[Work Date]
VAR ConfID=[Confirmation number]
....
RETURN
COUNTROWS(FILTER(TableName,[Employee]=Employee&&[Work Date]=Date&&[Confirmation number]=ConfID))
This measure should give you the number of appearances. Should be either 1 or 2.
Then you can create a reverse filter:
TotalNoDouble=CALCULATE(
SUM([Booked Hours],
FILTER(Table,NOT([Appearances]=2&&[Approval status]="not approved")))
Give it a try and let us know.
Best regards
- pnvinod8 years ago
Helper I
We can also use the below custom column to return 0 for duplicate records
RevisedHrs = if([Appearnces]=2&&[Approval status]="approved",0,[Booked hours])
Hope it helps
- Anonymous8 years agoNot applicable
Thank you for that cool calculated column! Tht works fine for me. I created the "Appearances" and take this column as a filter to 1 for all of the pages.