Forum Discussion

kagy100's avatar
kagy100
Advocate II
5 years ago
Solved

DAX Assistance Needed

Hi Team,

 

I am hoping to seek your assistance with the following issue . . 

 

I have a date table set up with these dates:

16/03/2021

16/02/2021

19/01/2021

15/12/2020

17/11/2020

 

My desired output is required in 2 columns:

Start Date       End Date

16/02/2021    16/03/2021

19/01/2021    16/02/2021

15/12/2020    19/01/2021

17/11/2020    15/12/2020

  • Hi, kagy100 

    Please check the below picture and the sample pbix file's link down below.

    Those are for creating new columns.

     

     

    Start date CC =
    CALCULATE (
    MAX ( 'Table'[Column1] ),
    FILTER ( 'Table', 'Table'[Column1] < EARLIER ( 'Table'[Column1] ) )
    )

     

     

    End date CC =
    IF( not ISBLANK( 'Table'[Start date CC]), 'Table'[Column1])
     
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

5 Replies

  • Hi, kagy100 

    Please check the below picture and the sample pbix file's link down below.

    Those are for creating new columns.

     

     

    Start date CC =
    CALCULATE (
    MAX ( 'Table'[Column1] ),
    FILTER ( 'Table', 'Table'[Column1] < EARLIER ( 'Table'[Column1] ) )
    )

     

     

    End date CC =
    IF( not ISBLANK( 'Table'[Start date CC]), 'Table'[Column1])
     
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

    • kagy100's avatar
      kagy100
      Advocate II

      Thank You Jihwan

       

      I encountered the following issue . . .

       

      Date

      21/04/2021

      16/03/2021

      16/02/2021

      19/01/2021

      15/12/2021

      17/11/2021

       

      Start Date CC gives me                   End Date CC gives me

      20/04/2021                                      21/04/2021

      15/03/2021                                      16/03/2021

      15/02/2021                                      16/02/2021

      18/01/2021                                      19/01/2020

      14/12/2020                                      15/12/2020

      16/11/2020                                      17/11/2020

       

      Formula Used

      Start Date CC =
      CALCULATE (
      MAX ( 'Table 1'[Date] ),
      FILTER ( 'Table 1', 'Table 1'[Date] < EARLIER ( 'Table 1'Date] ) )
      )
       
      End Date CC =
      IF( not ISBLANK( 'Table 1'[Start Date CC]), 'Table 1'[Date])
       
      Would you know why I'm getting this? 

       

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi, kagy100 

        Thank you for your feedback.

        I am not sure why the unshown date is showing on your startdate column.

        I think you connected the table to your dim-date table (or perhaps other table), but you are not showing it here.

         

        Please share your sample pbix file's link here, and also share ideas about how you want to see it as an outcome.

         

        Thank you.

         

    • kagy100's avatar
      kagy100
      Advocate II

      Hi Amit,

       

      End Date must be the latest date and Start Date must be the earliest. 

       

      For example:

      Date

      07/05/2021

      05/03/2021

      02/01/2021

      05/11/2020

       

      Output

      Start Date            End Date

      05/03/2021         07/05/2021

      02/01/2021         05/03/2021