cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mathieu_thelot Frequent Visitor
Frequent Visitor

Refresh Timsetamp Column apply to each group

In power bi desktop I'm searching to create a new column in a table
In my table "table_1", I have this kind of columns :

Group timestamp value
A 14/01/2016 5
B 14/01/2016 4
C 14/01/2016 6
...
A 16/01/2016 8
B 16/01/2016 7
...
A 20/01/2016 12



So to recape, at the end we have :
Group timestamp value
A 14/01/2016 12
B 16/01/2016 7
C 20/01/2016 6


I want to create a column "refresh":
First, we need to select the last timestamp (= 'last_global')
Then, we need to select for each group the actual last timestamp (='last').
After that, we need to check for each group :
if timestamp ='last' then return in "refresh" the 'last_global'
or
for each group if timestamp not last , then return timestamp

To be more explicit :

 

Group timestamp value | Refresh |
A 14/01/2016 5 | 14/01/2016 |
B 14/01/2016 4 | 14/01/2016 |
C 14/01/2016 6 | 20/01/2016 |
...
A 16/01/2016 8 | 16/01/2016 |
B 16/01/2016 7 | 20/01/2016 |
...
A 20/01/2016 12 | 20/01/2016 |


Refresh is not a measure but a column :

I want to have in my table something like this:

somewhere in my table:
Group timestamp value | Refresh |
..
A 14/01/2016 12 | 20/01/2016 |
..
B 16/01/2016 7 | 20/01/2016 |
..
C 20/01/2016 6 | 20/01/2016 |

If you have any proposition, don't hesitate
I suggest to stay in the same table but if it's easyer with an other method, I'm ok with that 😉

1 REPLY 1
Moderator v-qiuyu-msft
Moderator

Re: Refresh Timsetamp Column apply to each group

Hi @mathieu_thelot,

 

I'm not very clear about your requirement. How did you get 'last_global' and 'last'? If you want to get the last timestamp within each group value, you can create a table use the expression like below:

 

Table = SUMMARIZE('table_1','table_1'[Group],"last",LASTDATE('table_1'[timestamp]),"value",SUM('table_1'[value]))

 

w1.PNG

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)