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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Scaffnull
Helper I
Helper I

Date table (Pivot, unpivot?)

Hi everyone,

I have a question about a date table where I'd like to format so I can get total count of people and total hours per date. 
I got handled (picture, and filter the peoples names). So the week column continues until present week.

Datetable.png

I wonder if anyone has a solution to fix dates for this. So example week 22 monday (May 31st)  the total count of name is 8 and total hours 59. I've tried to invoke a date table, but it doesn't recognize that monday week 22 is that date and so on.

 

Thanks for any sort of help.

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

You need a date table, and your weeks need to have year indicators. Otherwise once you get 2 or more years, week 22 will be in different years.

When I get source data that only has info like this, adding the year is pretty easy. As for the date, you can use this method. It returns a table like this, that you can now create a relationship with a date table, and do your aggregations.

edhans_0-1640036771731.png

I did this in Excel, so Open up Power Query and look at the Table query.

Here is my file.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Community Champion
Community Champion

You need a date table, and your weeks need to have year indicators. Otherwise once you get 2 or more years, week 22 will be in different years.

When I get source data that only has info like this, adding the year is pretty easy. As for the date, you can use this method. It returns a table like this, that you can now create a relationship with a date table, and do your aggregations.

edhans_0-1640036771731.png

I did this in Excel, so Open up Power Query and look at the Table query.

Here is my file.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

@edhans Thank you for your reply. It worked, I created an empty query and imported a date table there in the advanced query, made the connection to the data table. I thought date for date was necessary but just kept it simple and displayed everything by weeks 🙂 

edhans
Community Champion
Community Champion

Great @Scaffnull - glad I was able to assist.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.