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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Bi-week Calculation

Hello everybody,

 

I need your help to make a calculate columns for my table. 

I have this kind of table, Where I want to add a new 2 columns :

 

Activities Dateactivityiduserid
08/02/2021actid1id1
15/02/2021actid2id1
17/02/2021actid3id1
11/02/2021actid4id2
23/02/2021actid5id3
24/02/2021actid6id1
25/02/2021actid7id1

 

the first column it will be the bi-week number and the second one the number of activity by user during each bi-week.

 

Activities Dateactivityiduseridbi-weekactivity by bi-week
08/02/2021actid1id1weeks 6-73
15/02/2021actid2id1weeks 6-73
17/02/2021actid3id1weeks 6-73
11/02/2021actid4id2weeks 6-71
23/02/2021actid5id3weeks 8-91
24/02/2021actid6id1weeks 8-92
25/02/2021actid7id1weeks 8-92

 

Thank you for your help.

 

Best,

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create two columns as follows.

bi-week = 

var x1=WEEKNUM([Activities Date],2)-1

var x2=IF((x1/2-INT(x1/2))>0,x1-1,x1)

return

"weeks"&" "&x2&"-"&x2+1
activity by bi-week = CALCULATE(COUNTROWS('Test'),ALLEXCEPT(Test,Test[bi-week],Test[userid]))

Result:

v-yuaj-msft_0-1615518743928.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create two columns as follows.

bi-week = 

var x1=WEEKNUM([Activities Date],2)-1

var x2=IF((x1/2-INT(x1/2))>0,x1-1,x1)

return

"weeks"&" "&x2&"-"&x2+1
activity by bi-week = CALCULATE(COUNTROWS('Test'),ALLEXCEPT(Test,Test[bi-week],Test[userid]))

Result:

v-yuaj-msft_0-1615518743928.png

 

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

@Anonymous , I am not clear on the logic you used for the last 2 columns in second table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello @amitchandak, I want to claculate the total of activity maked by one users every two weeks.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors