Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bbodnar
Regular Visitor

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!

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @bbodnar,

 

Please mark the proper answers as solutions.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi

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

Anonymous
Not applicable

Similar question is answered here. This may help you.

 

http://community.powerbi.com/t5/Desktop/Max-Row-Based-on-Insert-Date/td-p/446426

 

Thanks
Raj

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.