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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
christinaxxx
Helper I
Helper I

Measure to show target value at a point in time based on other DAX measures

I want to get the cumulative target at each point in time (red line) as an average trend. This is used to track how many customers each sales manager has onboarded to our new tech app. It sounds quite simple but I couldn't wrap my head around it. 

christinaxxx_2-1708564430657.png


The blue line is the total number of customer onboarded per week. Sample data table look like the below. It's summaried by manager by customer type per week. The start date is 2/11/2023 and the start value is not zero because I started tracking this half way through. The DAX I wrote for the blue line is WeeklyTotal = SUM(Fact_WeeklySummary[Customer Count])

 

christinaxxx_1-1708563160580.png

 

The target number is 90% of the customer base. The end date is 31/7/2024. The count of customer in the customer base is changing because every week there are new and exited customers. The DAX I wrote is Target = 0.9 * COUNTROWS(Dim_Customer)

 

And on top of the above, the red line will need to change as I change the slicer (Customer Type & Manager ID) and will include all date(or week) up to 31/7/2024 on the x-axis.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@christinaxxx , Try a measure like

 

CumulativeTargetTrend =
VAR _CurrentDate = MAX('Date'[Date])
VAR _StartDate = DATE(2023,2,11) // You can use Minx(allselected('Date'), 'Date'[Date])
VAR _EndDate = DATE(2024,7,31) // You can use Maxx(allselected('Date'), 'Date'[Date])
VAR WeeksElapsed = DATEDIFF(_StartDate, _CurrentDate, WEEK)
VAR TotalTarget = CALCULATE([Target], ALLSELECTED('Date'), 'Date'[Date] <= _CurrentDate)
RETURN IF(WeeksElapsed > 0, TotalTarget / WeeksElapsed, BLANK())

 

 

Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @christinaxxx ,

Is this your expected output?

vcgaomsft_0-1708673407450.png

If so, pelase try this:

Measure = 
VAR _numerator = CALCULATE([WeeklyTotal],'Fact_WeeklySummary'[WeekOf]<=MAX('Fact_WeeklySummary'[WeekOf]))
VAR _denominator = COUNTROWS(FILTER(ALLSELECTED('Fact_WeeklySummary'[WeekOf]),'Fact_WeeklySummary'[WeekOf]<=MAX('Fact_WeeklySummary'[WeekOf])))
VAR _result = DIVIDE(_numerator,_denominator)
RETURN
_result

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

Thank you. But I want the weekly incremental value to be the same. Something like (end value - start value) / count of weeks and then you add this weekly incremental value to last's week target value. I know the start and end values and they are measures.

christinaxxx_0-1708889862404.png

 

amitchandak
Super User
Super User

@christinaxxx , Try a measure like

 

CumulativeTargetTrend =
VAR _CurrentDate = MAX('Date'[Date])
VAR _StartDate = DATE(2023,2,11) // You can use Minx(allselected('Date'), 'Date'[Date])
VAR _EndDate = DATE(2024,7,31) // You can use Maxx(allselected('Date'), 'Date'[Date])
VAR WeeksElapsed = DATEDIFF(_StartDate, _CurrentDate, WEEK)
VAR TotalTarget = CALCULATE([Target], ALLSELECTED('Date'), 'Date'[Date] <= _CurrentDate)
RETURN IF(WeeksElapsed > 0, TotalTarget / WeeksElapsed, BLANK())

 

 

Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak  I used your solution with some minor twists and now it's working 🙂

Thank you. Not sure where I went wrong but my graph is like this

christinaxxx_0-1708572548939.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.