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

View all the Fabric Data Days sessions on demand. View schedule

Reply
yan23
Frequent Visitor

Calculate end date

Hello, 

 

I'm having trouble calculating the client's end date of a "phase".
I'm following this logic:
the phase's end date is the initial date of next one

 

                    initial          end 

Phase 1      1/1/2018      5/4/2018

Phase 2       5 /4/2018    5 /4/2018

Phase 3       5/4/2018     6/6/2018
Phase 4        6/6/2018

I'm using this formula but i dont get the results i need

FINTEST = CALCULATE(MIN(Test[FechaEtapa] ),
FILTER(Test, Test[IDPromocion] = FactDocumento[IDPromocion]  && Test[IDCliente] = FactDocumento[IDCliente]&& Test[CodSec] > (FactDocumento[Idsecuencia])))

any help would be great, thank you in advance

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @yan23,

 

You could create a index column in Query Editor first.

 

Untitled.png

 

Then you could create the calculated column with the DAX formula below.

 

Column =
VAR a =
    CALCULATE (
        MIN ( 'Sheet'[Index] ),
        FILTER ( ALL ( 'Sheet' ), 'Sheet'[Index] > EARLIER ( Sheet[Index] ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Sheet'[initial] ),
        FILTER ( 'Sheet', 'Sheet'[Index] = a )
    )

Here is the result output.

 

Capture.PNG

 

If you need additional help, please share some data sample and your desired output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @yan23,

 

You could create a index column in Query Editor first.

 

Untitled.png

 

Then you could create the calculated column with the DAX formula below.

 

Column =
VAR a =
    CALCULATE (
        MIN ( 'Sheet'[Index] ),
        FILTER ( ALL ( 'Sheet' ), 'Sheet'[Index] > EARLIER ( Sheet[Index] ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Sheet'[initial] ),
        FILTER ( 'Sheet', 'Sheet'[Index] = a )
    )

Here is the result output.

 

Capture.PNG

 

If you need additional help, please share some data sample and your desired output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

thank you it worked!Smiley Happy

Anonymous
Not applicable

Hi

 

The column you have used in the formula is not present in the sample data, could you please post the sample data for all required colmn ?

 

Thanks

Raj

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors