Showing results for 
Search instead for 
Did you mean: 
New Member

Pivoting a table by date to find the start and end of an event

Hello.  i'm in the situation as shown below:



i have 4 columns: 
name 1: a page visited
DateUTC: when it was visited
actionEvent: what has been done
Name 2: who done it
watching data is clare to understand when someone loged in and out from a page. but i dont know how to pivot this table to have a column access and one leave
to have something like this:  
name1, name2, loaded, leave
where leave can be null
can someone help me?

Super User
Super User

Hi @GDavi ,

In Power Query move Name 2 to beside name 1.

Select Access Event>Transform>Pivot Column>Select Date from Popup and don't aggregate from advance options.



Hope this helps

Did I help you today? Please accept my solution and hit the Kudos button.

Hi! i tried this, but unfortunatly it works only if i add a index column.
the final result is me having 4 columns: 
name 1
name 2
Loaded --> with the date of loading and some nulls
Leave --> with date of leaving with some nulls
it still don't pair together the access with his leave (that is not necessarily the next leave in line)
the think i need is similar to this, because i need those 4 columns, but i also need to not have null on the load column and to populate the leave column only with the correct date

Hi @GDavi, Can you send a before and after example with anonymous data so that I can better understand your problem.



Helpful resources

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.