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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors