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
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
v-yuaj-msft
Community Support
Community Support

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
v-yuaj-msft
Community Support
Community Support

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

Anonymous
Not applicable

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

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.