Forum Discussion

harshagraj's avatar
harshagraj
Post Partisan
3 years ago
Solved

Finding Minimum date

Hello all,

Please find the attached. I need to find the minimum snapshot date as highlighed below. A,B,D projects are showing correct minmum date but C & E is not showing correctly. I am adding the dax i used. 

 

CALCULATE(
    MIN(table[snap_date]),
    ALLEXCEPT(table,
    table[project_number],
    table[project_status_name],
    table[project_owner_name],
    table[project_name],
    table[project_current_phase_name],
    table[product_line_name],
    table[Customer C-Sample_date],
    table[C-Sample_date],
    table[Planned Design Freeze],
    table[Design Freeze Status],
    table[PPAP Customer],
    table[PPAP TEDX])
)

 

project_numberproject_current_phase_namePlanned Design FreezeMin Snapshot Date Yes or Nosnap_dateproject_owner_nameproject_status_nameC-Sample_datePPAP CustomerPPAP TEDXDesign Freeze StatusCustomer C-Sample_date
AProduction2/4/2020 0:001/26/2023 0:001/26/2023 0:00ABActive 6/10/2021 0:005/6/2021 0:00Completed2/9/2021 0:00
AProduction2/4/2020 0:001/26/2023 0:002/23/2023 0:00ABActive 6/10/2021 0:005/6/2021 0:00Completed2/9/2021 0:00
AProduction2/4/2020 0:001/26/2023 0:003/30/2023 0:00ABActive 6/10/2021 0:005/6/2021 0:00Completed2/9/2021 0:00
BValidation10/1/2020 0:001/26/2023 0:001/26/2023 0:00ABActive 11/29/2021 0:009/17/2021 0:00Completed7/2/2021 0:00
BValidation10/1/2020 0:001/26/2023 0:002/23/2023 0:00ABActive 11/29/2021 0:009/17/2021 0:00Completed7/2/2021 0:00
BValidation10/1/2020 0:001/26/2023 0:003/30/2023 0:00ABActive 11/29/2021 0:009/17/2021 0:00Completed7/2/2021 0:00
CValidation4/26/2021 0:001/26/2023 0:001/26/2023 0:00ABActive 5/1/2023 0:00 Completed3/6/2023 0:00
CValidation4/26/2021 0:002/23/2023 0:002/23/2023 0:00ABActive 5/18/2023 0:00 Completed3/23/2023 0:00
CValidation4/26/2021 0:003/30/2023 0:003/30/2023 0:00ABActive 6/8/2023 0:00 Completed4/13/2023 0:00
DValidation1/18/2022 0:003/30/2023 0:003/30/2023 0:00ABActive 9/1/2023 0:00 Completed5/24/2023 0:00
EValidation9/20/2022 0:001/26/2023 0:001/26/2023 0:00ABActive1/29/2023 0:002/22/2023 0:00 Completed3/10/2023 0:00
EValidation9/20/2022 0:002/23/2023 0:002/23/2023 0:00ABActive3/24/2023 0:005/4/2023 0:00 Completed5/5/2023 0:00
EValidation9/20/2022 0:002/23/2023 0:003/30/2023 0:00ABActive3/24/2023 0:005/4/2023 0:00 Completed5/5/2023 0:00

amitchandak 

  • Hi harshagraj ,

     

    MinOfSnapDate =
    CALCULATE (
        MIN ( 'Table (2)'[snap_date] ),
        FILTER (
            ALLSELECTED ( 'Table (2)' ),
            'Table (2)'[project_number] = SELECTEDVALUE ( 'Table (2)'[project_number] )
        )
    )

     

    If I helped, Accept it as a solution.

    Regards,

    Loran

1 Reply

  • Hi harshagraj ,

     

    MinOfSnapDate =
    CALCULATE (
        MIN ( 'Table (2)'[snap_date] ),
        FILTER (
            ALLSELECTED ( 'Table (2)' ),
            'Table (2)'[project_number] = SELECTEDVALUE ( 'Table (2)'[project_number] )
        )
    )

     

    If I helped, Accept it as a solution.

    Regards,

    Loran