Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.