Forum Discussion

Saxon10's avatar
Saxon10
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Calculate Max date by filter two columns

  I have a two tables are data and report         In data table contain item, country, date, time and area code         In data table country column has India, Pak, US, U...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    5 years ago

    Hi, Saxon10 

    Please check the below-updated link that includes the calculated column.

     

    https://www.dropbox.com/s/hjra12fkfkixrvl/saxon10.pbix?dl=0 

     

    Max Date new column =
    VAR countriescondition =
    SUMMARIZE ( FILTER ( Data, Data[ITEM] = Report[ITEM] ), Data[COUNTRY] )
    VAR newtable =
    FILTER (
    Data,
    Data[ITEM] = Report[ITEM]
    && Data[COUNTRY]
    IN { "INDIA", "US", "UK", "NEWL" }
    && Data[AREA CODE] IN { "A" }
    )
    RETURN
    IF (
    COUNTROWS ( countriescondition ) >= 4,
    MAXX ( newtable, Data[DATE] ),
    BLANK ()
    )

     

    If you write calculated measure, the table visualization already has the filter for the item, so I did not mention the item column in the calculated measure.

    However, as you can see in the calculated column, I had to mention the item column.

     

    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.