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
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
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.