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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Split rows based on condition

Hi Community,

 

Hope everyone is doing well.

 

I'm struggling to split rows based on condition. Following is the format of data;

Employee CodeLeave Start DateLeave End DateHoursPeriod End Datestart weekDays diffNet work days
9385/10/202023/10/20207523/10/2020411815
88418/12/20201/01/202137.51/01/2021511411
2055/04/202119/04/202167/05/2021151411
4985/12/202018/12/20207518/12/2020491310
4987/11/202020/11/20207520/11/2020451310

 

I want to put a condition on days diff as follows;

 

Daysdiff > 14 = 3 rows

Daysdiff > 7 = 2 rows

Daydiff < 7 = 1 row

 

with the split, I need two columns such as "Start of week" and "Apportioned hours"

 

Following is what I expect to see as the result;

 

Employee CodeLeave Start DateLeave End DateHoursPeriod End Datestart weekDays diffNet work daysApportioned hoursStart of week
9385/10/202023/10/20207523/10/2020411815255/10/2020
9385/10/202023/10/20207523/10/20204118152512/10/2020
9385/10/202023/10/20207523/10/20204118152519/10/2020

 

Any help with this is highly appreciated.

 

Thank you in advance

 

Best regards,

Ashan

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

4 REPLIES 4
wdx223_Daniel
Super User
Super User

wdx223_Daniel_0-1625106099983.png

 

Anonymous
Not applicable

Hi @wdx223_Daniel,

 

Can you please let me know the change in code if there is a text column such as employee name?

 

Best Regards,

Ashan.

Anonymous
Not applicable

Hi @wdx223_Daniel,

 

Thank you so much for your solution. Can you please explain what you have done to get results

 

Best regards,

Ashan.

all codes have been shown, i do not know how to explain further.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors