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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
usamajadi
Regular Visitor

Group By Using Weeks

Hi All

 

I am new in Power Bi.

i want a weekly group by column and count the weekly record sum in another column

 

Thanks in Advance

3 REPLIES 3
Anonymous
Not applicable

I have a similar objective, though I need to sum a duration column grouping on the week and on another column. My data looks like this:

From PersonDateDuration MinutesWeek Number
Person A2022-01-115463
Perosn B2022-01-115343
Person C2022-01-114773
Person A2022-01-124853
Person B2022-01-125003
Person C2022-01-125403
...   
Person A2022-03-3055514
Person B2022-03-3049314
Person C2022-03-3050014

Etc.

 

My objective is to create a visual report table or matrix that shows the summation of the Duration Minutes by week.

 

I work on my reports and stuff only ever few weeks so I may be forgetting some simple solution.

 

Thanks again to any who can lend insign and teach me how to do this.

 

Best Regards

v-sihou-msft
Microsoft Employee
Microsoft Employee

Hi @usamajadi,

 

In this scenario, you need to add a week number column like "Week =WEEKNUM(Table[DateColumn])" as @Greg_Deckler suggested. To calculate weekly count, you need to group the rows using ALLEXCEPT in CALCULATE().

 

=CALCULATE(COUNT(Table[column]),ALLEXCEPT(Table,Table[WeekNum]))

Reference:
ALLEXCEPT Function (DAX)

 

 

Regards,

Greg_Deckler
Community Champion
Community Champion

I would create a new column using this formula:

 

Week =WEEKNUM(Table[DateColumn])

Then I would create a new measure

 

MyCount = COUNT(Table[SomeColumn])

If you put "Week" column in a table and then your measure "MyCount", the "MyCount" will be filtered based upon the table row and you will have a table of the count of weekly records per week.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.