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
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
jt1024
Helper II
Helper II

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
Employee
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
Super User
Super User

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.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.