cancel
Showing results for
Search instead for
Did you mean:
Frequent Visitor

## Measure that creates an arithmetic progression of a value for as many rows as selected

Good afternoon, I am trying to recreate this table:

This is what I have so far

The Target on % to target is a value derived from a slider. I have calculated the first three columns, the one I am having a hard time calculating the highlighted one, the target by week. I have managed to get the value needed per week dividing the Target value by the number of rows shown which is the number of weeks like this:

Weekly Target Leads = [Quarterly Lead Goal Value]/COUNTROWS(ALLSELECTED(Dates[Weeks]))

But if I do it like this I would now need to sum the value of the previous row each time, or multply the number I got, in this case 115 by an incresing index for each week. I have tried many things and none have worked. Hopefully you guys can give me some ideas, thank you in advance.

2 REPLIES 2
Super User

@questionaskr , I think you need last wek values. For that in date or week table have week Rank column

new columns
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format

Then you can measures like
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Frequent Visitor

Thank you for your anwser, but I dont think it solves the problem, I am not looking for the weekly change, rather I am trying to create a column in that table to know how far off are we each week or reaching the target. This column should increase each week by the same amount, this amount is the quarterly goal divided by the number of weeks in the quarter and this goal is set by a slider so that it can be dynamically changed. So as stated, this new column is an arithmetic progression of Weekly Target Leads

## Helpful resources

Announcements

#### Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors