Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello community,
can onyone help me to calculate the number of days until a value doubles? I have searched online but couldnt find helpful ressources. Does anyone have something at hand?
Solved! Go to Solution.
Hi, @raymond
Based on my research, you may create a measure as below.
CountDays =
var _maxdate =
CALCULATE(
MAX('Table'[Date]),
ALLSELECTED('Table')
)
var _maxvalue =
LOOKUPVALUE(
'Table'[Value],
'Table'[Date],
_maxdate
)
var _halfvaluedate =
LOOKUPVALUE(
'Table'[Date],
'Table'[Value],
CALCULATE(
MAX('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
'Table'[Value]<=_maxvalue/2
)
)
)
return
DATEDIFF(
_halfvaluedate,
_maxdate,
DAY
)+1
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @raymond
Based on my research, you may create a measure as below.
CountDays =
var _maxdate =
CALCULATE(
MAX('Table'[Date]),
ALLSELECTED('Table')
)
var _maxvalue =
LOOKUPVALUE(
'Table'[Value],
'Table'[Date],
_maxdate
)
var _halfvaluedate =
LOOKUPVALUE(
'Table'[Date],
'Table'[Value],
CALCULATE(
MAX('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
'Table'[Value]<=_maxvalue/2
)
)
)
return
DATEDIFF(
_halfvaluedate,
_maxdate,
DAY
)+1
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It should work a little like this. Depending on the date selection one makes, the measure should calculate the number of days that are between the largest value (here accumulated) and half of the value.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!