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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
sarveshkalyan
Advocate I
Advocate I

To Find the earliest date of a measure when running total crosses a threshold

Hi,

I am faced with a challenge of getting the earliest date of a measure in powerbi, since it is a measure i am not able to proceed without column references.

This is a sample dataset,

AppsTotalCountRunning CountPercent CoveredTarget Reached(>85%)DateEarliest Date
11160474778%No10/12/202115/12/2021
1116035083%No13/12/202115/12/2021
1116095998%Yes15/12/202115/12/2021
11160160100%Yes17/12/202115/12/2021
12434272779%No19/12/202121/12/2021
1243433088%Yes21/12/202121/12/2021
1243423294%Yes23/12/202121/12/2021

sarveshkalyan_0-1660752419350.png

Here, except for App Code, Count, Date, all the other fields are measures. Earliest Date is the field that i wish to calculate

Earliest date is the first date when a running total count specific to an app crosses the 85% threshold.

 
With the following measure i am able to get multiple dates, but i am not able to apply FIRSTDAY, RANKX OR TOPN to get the 1st output without a column reference
Date after 85% =
IF('App Progress'[Percent Covered]>=0.85,
    MINX('App Progress','App Progress'[Date]) ,
BLANK())
 
The following measure gives me just the 1st day in each app, i want to modify this to include the threshold >85% to get the expected value
Earliest Date =
    VAR _App = MIN('App Progress'[Apps])
    RETURN
MINX( FILTER(ALL('App Progress'), 'App Progress'[Apps] = _App),'App Progress'[Date])
 
Please let me know on how to proceed
 
 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Does it have to be measures?  These facts seem to be immutable (not impacted by user filter choices) so calculated columns should be sufficient.

Percent Covered = 
var a = [Apps]
var d = [Date]
return divide(calculate(sum('App Progress'[Count]),ALL('App Progress'),'App Progress'[Apps]=a,'App Progress'[Date]<=d),[Total])

Earliest Date = 
var a = [Apps]
return calculate(minx('App Progress','App Progress'[Date]),ALL('App Progress'),'App Progress'[Apps]=a,'App Progress'[Percent Covered]>=0.85)

 

see attached.

View solution in original post

2 REPLIES 2
sarveshkalyan
Advocate I
Advocate I

Thanks, you are right. Calculated columns helped me to solve this 

lbendlin
Super User
Super User

Does it have to be measures?  These facts seem to be immutable (not impacted by user filter choices) so calculated columns should be sufficient.

Percent Covered = 
var a = [Apps]
var d = [Date]
return divide(calculate(sum('App Progress'[Count]),ALL('App Progress'),'App Progress'[Apps]=a,'App Progress'[Date]<=d),[Total])

Earliest Date = 
var a = [Apps]
return calculate(minx('App Progress','App Progress'[Date]),ALL('App Progress'),'App Progress'[Apps]=a,'App Progress'[Percent Covered]>=0.85)

 

see attached.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.