Forum Discussion

LD's avatar
LD
Frequent Visitor
6 years ago
Solved

Max Date by Condiction

Dear,

I have the following situation:

 

Raw Data

 

Column 1             Column 2             Column 3

ID 1                         Task 1                      Due Date A

ID 1                         Task 2                      Due Date B

ID 2                         Task 1                      Due Date C

ID 3                          Task 1                     Due Date D

ID 3                          Task 2                    Due Date D

ID 3                          Task 3                    Due Date E

ID n                            ......                            ......

 

I need to select the due max due date, excluding the task 2 and considering the Column 1.

The result is the association of Max due date to ID (1,2,3, n) excluding some condiction (by Column 2).

 

Thank you!!!!

LD

 

  • LD's avatar
    LD
    6 years ago

    Hi camargos88 ,

     

    Yes:

     

    Column1Column2Due DateMeasure
    ID1Task Type AJan 31, 20March 31, 20
    ID1Task type BMar 31, 20March 31, 20
    ID2Task Type AAug 22,20Aug 22,20
    ID3Task Type AApr 18, 20Apr 18, 20
    ID3Task Type CJun 20, 20 Apr 18, 20
    ID4Task Type AApr 18, 20May 05,20
    ID4

    Task Type B

    May 05,20May 05,20
    ID4Task Type CJun 15, 20May 05,20

     

    so the task type C, is not considered into max value

     

    Thank you

    LD

  • LD ,

     

    Try this measure:

     

    Measure = CALCULATE(MAX('Table'[Due Date]); FILTER(ALLEXCEPT('Table'; 'Table'[Column1]); 'Table'[Column2] <> "Task Type C"))
     
    Ricardo

7 Replies

  • camargos88's avatar
    camargos88
    Icon for Community Champion rankCommunity Champion

    Hi LD ,

     

    Try this measure:

    Measure = CALCULATE(MAX('Table'[Column 3]); ALLEXCEPT('Table'; 'Table'[Column 1]))
     
     

    If you consider it as a solution, please mark as a solution and kudos.

    Ricardo

     

    • LD's avatar
      LD
      Frequent Visitor

      Dear camargos88 ,

      Command is quite ok..., Please, I need to exclude some row based on the Column2 (for example Task2 in Cl2)

       

      Thank You

       

      LD

      • camargos88's avatar
        camargos88
        Icon for Community Champion rankCommunity Champion

        LD ,

         

        I didn't get what you want. 

         

        Can you explain more ?

         

        Ricardo