Forum Discussion

faint127's avatar
faint127
Frequent Visitor
6 years ago
Solved

Calculated Column grouped by Category and condition

Hey Guys

 

Im trying to create a Calculated Column (Calculated Date) that returns the last DateWithData, grouped by Product.

 

I can only manage to get min by Product

CALCULATE(min(Table1[DateWithData]), ALLEXCEPT(Product[ProductName]))

 

Any ideas?


Thanks in advance

  • Hi faint127 ,

     

    Here we go.

     

    calculated date =
    VAR currecntdate = [Data]
    RETURN
        CALCULATE (
            MAX ( 'Table (2)'[datewithdata] ),
            FILTER (
                'Table (2)',
                'Table (2)'[Product] = EARLIER ( 'Table (2)'[Product] )
                    && 'Table (2)'[Data] <= currecntdate
            )
        )
    

     

2 Replies