Forum Discussion
Anonymous
6 years agoNot applicable
Create new column checking on other columns data
Hello Community! I have a Table with the first 2 columns of the following example (ID and Time_1), and I need to add a third column (Time_2), in order to get something like this: ID Time_1 ...
- 6 years ago
Anonymous - Try this:
Time_2 = VAR __Time_1 = [Time_1] VAR __Num = COUNTROWS(FILTER('Table (18)',[ID]=EARLIER([ID]))) RETURN __Time_1/__NumPBIX is attached below sig. Table (18).
nandic
6 years agoResident Rockstar
Anonymous ,
Try this formula:
Time_2 =
var _Id_Amount = CALCULATE(MIN('Table'[Time_1]),'Table'[ID]=EARLIER('Table'[ID]))
var _Id_Count = CALCULATE(COUNTROWS('Table'),'Table'[ID]=EARLIER('Table'[ID]))
RETURN
DIVIDE(_Id_Amount,_Id_Count)
Anonymous
6 years agoNot applicable
Hi nandic
Thanks for your help.
But I am not getting the result I was expecting.
The column Time_2 shows me the Time_1 value.
Looks like _Id_Count is not counting the number of times the ID appears in the column.
I tried creating the column _Id_Count separatelly, and I get 1 as a result for each row.
In my example I should get something like:
I hope this is clear. Do you know what I should do?
Thanks again!
- Greg_Deckler6 years agoCommunity Champion
Anonymous - Try this:
Time_2 = VAR __Time_1 = [Time_1] VAR __Num = COUNTROWS(FILTER('Table (18)',[ID]=EARLIER([ID]))) RETURN __Time_1/__NumPBIX is attached below sig. Table (18).