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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.