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
RachelN
Regular Visitor

Group by Week for multiple tables

Hi guys,

 

I hope you are all safe during this time.

I'm a new Power BI user and hope that you can help me with the best approach to solve this.

 

I have three table name Timesheet (include Staff Name, working date, working hours per date); Trello Work (includes Staff Name, working date, completed task items, hours per task item); Non-Trello work (includes Staff Name, working date, Additional ask types, hours per tasks).

Timesheet table.PNG

 

Non-Trello Table.PNG

 

 

I want to create a visualization to show Timesheet hours, Trello Work hours, Non-Trello work hours every week.

 

My relationship setting is Timesheet table is joined with Trello Work and Non-Trello work table by Staff name.

 

I created a new column "Week of Year" in Timesheet table; then use matrix table in visualization to show Timesheet hours, Trello Work hours, Non-Trello work hours every week. The issue is the Week of year of works for Timesheet hours, and not the other tables (Week 6 & 9 are the same for Trello hours, Week 6 & 7 are the same for Non-trello hours)

 
 

Power Bi by weeks.PNG

Please let me know if you need additional information. Thank you in advance!

 

Best regards,

 

 

 

2 ACCEPTED SOLUTIONS
v-lid-msft
Community Support
Community Support

Hi @RachelN ,

 

We can try to create a calendar dim-table to connect other tables and use WeekNum column of it as the row of visual:

 

CalendarTable =
ADDCOLUMNS ( CALENDARAUTO (), "WeekNum", WEEKNUM ( [Date] ) )

 

We can also Create Staff dim-table by using following dax:

 

Staff =
DISTINCT (
    UNION (
        DISTINCT ( 'Timesheet'[Staff Name] ),
        DISTINCT ( 'Trello Work'[Staff Name] ),
        DISTINCT ( 'Non-Trello work'[Staff Name] )
    )
)

 


Best regards,

 

Community Support Team _ Dong 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

Hi @v-lid-msft @amitchandak, thank you so much for your kind support! I've achieved the outcome that I want for my data. I really appreciate your help!

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @RachelN ,

 

We can try to create a calendar dim-table to connect other tables and use WeekNum column of it as the row of visual:

 

CalendarTable =
ADDCOLUMNS ( CALENDARAUTO (), "WeekNum", WEEKNUM ( [Date] ) )

 

We can also Create Staff dim-table by using following dax:

 

Staff =
DISTINCT (
    UNION (
        DISTINCT ( 'Timesheet'[Staff Name] ),
        DISTINCT ( 'Trello Work'[Staff Name] ),
        DISTINCT ( 'Non-Trello work'[Staff Name] )
    )
)

 


Best regards,

 

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

Hi @v-lid-msft @amitchandak, thank you so much for your kind support! I've achieved the outcome that I want for my data. I really appreciate your help!

amitchandak
Super User
Super User

Create a common date dimension. Join with other tables have you week calculation there and then use that for visual.

 

Also refer: https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

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.