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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.