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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hyggins
Helper I
Helper I

DAX calculation to find Date when total becomes a certain value (2x, 3x, etc.)

Good afternoon!

 

I have three columns: Date, Running Total and Growth. I am wanting to create another column ("Date Doubled") that indicates when, on a later date, the Running Total doubled.  See example data below. On 1/1 the Running Total was 621. On 1/4 the Running Total was 1,247. This is the earliest date when Running Total was equal to or more than the 1/1 value of 621. Thank you!

 

DateRunning TotalGrowthDate Doubled
1/1/2020621 1/4/2020
1/2/20207721511/6/2020
1/3/202010262541/7/2020
1/4/202012472211/8/2020
1/5/202015252781/10/2020
1/6/202020004751/11/2020
1/7/20202366366 
1/8/20202651285 
1/9/20202808157 
1/10/202039291121 
1/11/20204638709 
1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

Hi @hyggins ,

 

Try this code :

 

Column =
VAR _date = 'Table'[Date]
VAR _value = 'Table'[Running Total]
RETURN CALCULATE(MIN('Table'[Date]); FILTER(ALL('Table'); 'Table'[Running Total] >= _value * 2))


 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
camargos88
Community Champion
Community Champion

Hi @hyggins ,

 

Try this code :

 

Column =
VAR _date = 'Table'[Date]
VAR _value = 'Table'[Running Total]
RETURN CALCULATE(MIN('Table'[Date]); FILTER(ALL('Table'); 'Table'[Running Total] >= _value * 2))


 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



az38
Community Champion
Community Champion

Hi @hyggins 

Date Doubled = 
CALCULATE(
MIN('Table'[Date]), 
FILTER(ALL('Table'),'Table'[Running Total] >= 2* SELECTEDVALUE('Table'[Running Total]) )
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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