Forum Discussion

bbodnar's avatar
bbodnar
Regular Visitor
8 years ago
Solved

Filter by date column

Hello, community!

I'm new in power bi and I need your help :)

I have a table "Cash_flow", there are the columns with:

  1. flat ID,
  2. contract ID,
  3. date
  4. contract value.

One flat can have several contracts. I want to get only contracts with the latest date by one flat. 

Can anybody help me?

Thank you in advance!

  • Hi bbodnar,

     

    You can create a measure and add it in the Visual level filter if you don't want to add it in the visual. 

    Measure =
    VAR maxDate =
        CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[FlatID] ) )
    RETURN
        IF ( MIN ( Table1[Date] ) = maxDate, 1, BLANK () )
    

    Filter_by_date_column

     

    Best Regards,

    Dale

4 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi bbodnar,

     

    You can create a measure and add it in the Visual level filter if you don't want to add it in the visual. 

    Measure =
    VAR maxDate =
        CALCULATE ( MAX ( Table1[Date] ), ALLEXCEPT ( Table1, Table1[FlatID] ) )
    RETURN
        IF ( MIN ( Table1[Date] ) = maxDate, 1, BLANK () )
    

    Filter_by_date_column

     

    Best Regards,

    Dale

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi

      Is there any way to create this dynamically with respect Max Date Selected in Date Slicer.