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

Create a group based on to columns

I have data which is layed out like below:

NameDateWeekCall Time (Hours)
Person 111/09/20373.4
Person 211/09/2037

2.4

Person 311/09/20374.3
Person 110/09/20373.1
Person 210/09/20371.4
Person 310/09/20372.3
Person 109/09/20374.7
Person 209/09/20373.9
Person 309/09/20372.6
etcetcetcetc

 

And I'm looking to create an additional colum that sums up the total call time per person per week.

 

The problem is I can't figure out how to create either a column or group that allows me to do this. So how would I go about this?

 

Thanks

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @morgancampbell ,

Based on your description, you can create this calculated column:

Sum =
CALCULATE (
    SUM ( 'Table'[Call Time (Hours)] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Name] = EARLIER ( 'Table'[Name] )
            && 'Table'[Week] = EARLIER ( 'Table'[Week] )
    )
)

For Person 1:

week sum.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @morgancampbell ,

Based on your description, you can create this calculated column:

Sum =
CALCULATE (
    SUM ( 'Table'[Call Time (Hours)] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Name] = EARLIER ( 'Table'[Name] )
            && 'Table'[Week] = EARLIER ( 'Table'[Week] )
    )
)

For Person 1:

week sum.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@morgancampbell ,

Create columns like

week Year = year([Date])*100 + WEEKNUM([Date],2) //use 1 for sunday week

 

week sum person wise = sumx(filter(Table, [Week year] =earlier([Week year]) && [person] =earlier([person]) ),[Call Time (Hours)])

 

Then create a bucket on week sum person wise

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.