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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
pan
Frequent Visitor

Running total then return date when target is reached?

Hi!

 

I have data arranged as follows:

 

Year, Product , Gross Sales

 

I then created measures for Rolling Averages (for preceding three years. This serves as the Target), Running totals (would reset annually), and Target Status(whether the running totals exceeds the rolling average).

 

Now, I want to return the Month (using a date table) by finding the minimum date where running total is greater than target but since I'm using a measure as reference and not an absolute value, an error is returned that a Calculate function is used in a filter and that it is not allowed. How would I go around this?

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@pan

 

You should apply all dates as row context in FILTER() function to compare two measures. 

 

AchieveDay = CALCULATE(MIN(Table4[Date]),FILTER(ALL(Table4[Date]),[ytd]>[AVG]))

 

123.PNG

Regards,

 

Hi! Thanks for your response. But I also want to filter by product. Using your formula, it only returns the same date regardless of the product. I'm sorry I'm really new to Power BI

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.