Forum Discussion
Anonymous
6 years agoNot applicable
Need help created a new column with formula
I have a table called Team Members with columns called prop_id, Allocation, and Role. Unfortunately, Allocation is not always correct in the data source for some situations and it can't be fixed easi...
- 6 years ago
Hi Anonymous ,
We can create a calculated column as below.
Column = VAR a = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[Role] = "Lead" && 'Table'[prop_id] = EARLIER ( 'Table'[prop_id] ) && 'Table'[Member ID] <= EARLIER ( 'Table'[Member ID] ) ) ) VAR b = CALCULATE ( SUM ( 'Table'[Allocation] ), FILTER ( 'Table', 'Table'[Role] = "Lead" && 'Table'[prop_id] = EARLIER ( 'Table'[prop_id] ) && 'Table'[Member ID] <= EARLIER ( 'Table'[Member ID] ) ) ) RETURN IF ( NOT ( ISBLANK ( a ) ) && b = 0, 100, 'Table'[Allocation] )
Nathaniel_C
Community Champion
6 years agoHi Anonymous ,
So the logic is count the number of rows of prop id, and if 1 and if role = lead, then change to 100 else just use the existing allocation. Correct?
Have to go off line for a bit, but tell me if you can write this, else I will do when I am back.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Anonymous
6 years agoNot applicable
Count the number of rows of prop_id where role='lead'. If it = 1, then set Corrected Allocation to 100. Else, Corrected Allocation = Allocation.