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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
NPC
Helper I
Helper I

Moving Target

Hello,

I need to create a taget that increases automatically by 200 each week on Thursdays. The target will be diplayed on a card. The code below works but I want to avoid hard coding dates because then I'll have to manually change the date at the beggining on next year.
 
Thanks for your help. Below is what I came up with.
 
Moving Target =
 
VAR WK45 = 200*13
VAR WK46 = 200*14
VAR WK47 = 200*15
VAR WK48 = 200*16
VAR WK49 = 200*17
VAR WK50 = 200*18
VAR WK51 = 200*19

 

return
IF(TODAY()>=DATE(2021,11,11) && TODAY()<=DATE(2021,11,17), WK45,
IF(TODAY()>=DATE(2021,11,18) && TODAY()<=DATE(2021,11,24), WK46,
IF(TODAY()>=DATE(2021,11,25) && TODAY()<=DATE(2021,12,01), WK47,
IF(TODAY()>=DATE(2021,12,02) && TODAY()<=DATE(2021,12,08), WK48,
IF(TODAY()>=DATE(2021,12,09) && TODAY()<=DATE(2021,12,15), WK49,
IF(TODAY()>=DATE(2021,12,16) && TODAY()<=DATE(2021,12,22), WK50,
IF(TODAY()>=DATE(2021,12,23) && TODAY()<=DATE(2021,12,31), WK51)))))))
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Try something like this:

Target = 200 * ( 13 + ROUNDDOWN ( ( TODAY() - DATE ( 2021, 11, 11 ) ) / 7, 0 ) )

This adds the number of weeks beyond the initial 11/11/2021 to 13 before multiplying by 200.

View solution in original post

2 REPLIES 2
NPC
Helper I
Helper I

Much appreciated!

AlexisOlson
Super User
Super User

Try something like this:

Target = 200 * ( 13 + ROUNDDOWN ( ( TODAY() - DATE ( 2021, 11, 11 ) ) / 7, 0 ) )

This adds the number of weeks beyond the initial 11/11/2021 to 13 before multiplying by 200.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.