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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
reibalboaOMG
Helper I
Helper I

formula for week of update vs campaign end date

hi Everyone i'm having a problem

here's the sample date 

reibalboaOMG_0-1678325990151.png

week of update is jan 22 - feb 12 campaign end date jan 31

 

what i need is a formula that will show the week number 

here's my formula : 

weeknumber = WEEKNUM('Template (2)'[Campaign End Date] - 'Template (2)'[Week of Update])

reibalboaOMG_1-1678326245574.png

jan 22 = weeknumber 2

jan 29 = weeknumber 1

but on Feb 5 and 12/ post campaign date should be a 100% because it has reached its maximum

 

the expected output should be 

jan 22 : 2

jan 29 : 1

feb 5 : 1 

feb 12 : 1

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @reibalboaOMG 

try like:

weeknumber = 
VAR _n =
WEEKNUM('Template (2)'[Campaign End Date], 2) -
WEEKNUM('Template (2)'[Week of Update], 2)
RETURN
IF(
    [Week of Update]>=[Campaign End Date],
    1, _n
)

View solution in original post

2 REPLIES 2
reibalboaOMG
Helper I
Helper I

thank you @FreemanZ i'll try this 

FreemanZ
Super User
Super User

hi @reibalboaOMG 

try like:

weeknumber = 
VAR _n =
WEEKNUM('Template (2)'[Campaign End Date], 2) -
WEEKNUM('Template (2)'[Week of Update], 2)
RETURN
IF(
    [Week of Update]>=[Campaign End Date],
    1, _n
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.