Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
frederic_FAURE
New Member

Multiple date row data

Hi There,

I need to have your help to solve an issue that i have. Indeed, i have the following main table with employee and list of start date and end date (phases per month) I would like to have this phase per year with the start date and end date as desscribed below

frederic_FAURE_0-1734545634242.png

how can i achieved this ?

Thanks a lot for your help

Frédéric

2 ACCEPTED SOLUTIONS
dufoq3
Super User
Super User

Hi @frederic_FAURE , check this:

 

Output

dufoq3_0-1734547407848.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdFLCsAgDATQqxTXRUz81Xt0Jy57gvb+tFIwDMxy5GWEpHd3XvfjdqfVb+I3DZq+FMXS2BeaT8tos4QmQk+kJpkJltBk6MnUFOgp1FToqdQcYA5qGvzVqJGASwxcCVQJ37UodvFt/7MZrpbp1aapFsZ4AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EmpName = _t, start = _t, end = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"EmpName", type text}, {"start", type date}, {"end", type date}}),
    RenamedColumns = Table.RenameColumns(ChangedType,{{"start", "startDate"}, {"end", "endDate"}}),
    GroupedRows = Table.Group(RenamedColumns, {"EmpName", "startDate"}, {{"start", each List.Min([startDate]), type date}, {"end", each List.Max([endDate]), type date}}, 0,
        (x,y)=> Value.Compare(Date.StartOfYear(y[startDate]), Date.StartOfYear(x[startDate])) ),
    RemovedColumns = Table.RemoveColumns(GroupedRows,{"startDate"})
in
    RemovedColumns

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

Omid_Motamedise
Super User
Super User

This is the proces for solving your problem, consider the below table (column Start and end are in type Date)

Omid_Motamedise_0-1734558871094.png

 

select start column and from add column tab, Date section, pick Year (as below)

Omid_Motamedise_1-1734558935954.png

then select the column EmpName and Year (added by the previous step) and from home tab pick group by command and make the below setting

Omid_Motamedise_2-1734559026107.png

 

 

it solve the problem and results in 

 

Omid_Motamedise_3-1734559044691.png

 

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

View solution in original post

4 REPLIES 4
frederic_FAURE
New Member

Thanks a lot for the quick anwsers !

Anonymous
Not applicable

Hi @frederic_FAURE ,

Thanks for all the replies!
And @frederic_FAURE , if Omid_Motamedise's and frederic_FAURE's replies can help you solve your problem, please remember to accept their replies as solutions to help the other members find it more quickly. Thank you!

Best Regards,
Dino Tao

Omid_Motamedise
Super User
Super User

This is the proces for solving your problem, consider the below table (column Start and end are in type Date)

Omid_Motamedise_0-1734558871094.png

 

select start column and from add column tab, Date section, pick Year (as below)

Omid_Motamedise_1-1734558935954.png

then select the column EmpName and Year (added by the previous step) and from home tab pick group by command and make the below setting

Omid_Motamedise_2-1734559026107.png

 

 

it solve the problem and results in 

 

Omid_Motamedise_3-1734559044691.png

 

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
dufoq3
Super User
Super User

Hi @frederic_FAURE , check this:

 

Output

dufoq3_0-1734547407848.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdFLCsAgDATQqxTXRUz81Xt0Jy57gvb+tFIwDMxy5GWEpHd3XvfjdqfVb+I3DZq+FMXS2BeaT8tos4QmQk+kJpkJltBk6MnUFOgp1FToqdQcYA5qGvzVqJGASwxcCVQJ37UodvFt/7MZrpbp1aapFsZ4AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [EmpName = _t, start = _t, end = _t]),
    ChangedType = Table.TransformColumnTypes(Source,{{"EmpName", type text}, {"start", type date}, {"end", type date}}),
    RenamedColumns = Table.RenameColumns(ChangedType,{{"start", "startDate"}, {"end", "endDate"}}),
    GroupedRows = Table.Group(RenamedColumns, {"EmpName", "startDate"}, {{"start", each List.Min([startDate]), type date}, {"end", each List.Max([endDate]), type date}}, 0,
        (x,y)=> Value.Compare(Date.StartOfYear(y[startDate]), Date.StartOfYear(x[startDate])) ),
    RemovedColumns = Table.RemoveColumns(GroupedRows,{"startDate"})
in
    RemovedColumns

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.