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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Spotto
Helper IV
Helper IV

Get the Same or Previous Date- Help

Hello everyone, I have a TABLE A where I have a date, I need to get the TRAVA field of TABLE B with the date equal to or before the date of table A
I am not able to find a solution for this.

 

 

Spotto_0-1658744509566.png

 

Example Power Bi 

 

Thank you for your help

5 REPLIES 5
v-jianboli-msft
Community Support
Community Support

Hi @Spotto ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @Spotto ,

 

Please try:

Create a measure:

Measure = MAXX(FILTER('TABLE B',[CONTRATO]=MAX('TABLE A'[CONTRATO])&&[DATA]<=MAX('TABLE A'[DATA])),[TRAVA])

Then Apply it to the visual

Output:

vjianbolimsft_0-1659093541295.png

 

Best Regards,

Jianbo Li

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

thanks for the help but I needed to return the same date or before the date. In the example contract 222b has the date jan/05, the same or earlier date would be jan/03 and the result would be F

 

Spotto_0-1659720262371.png

 

amitchandak
Super User
Super User

@Spotto , A new column in Tbale A

 

New column =

var _max  = maxx(filter(TableB, TableB[Contrado] = TableA[Contrado] && TableB[Date] <= TableA[Date]), TableB[Date])

return

maxx(filter(TableB, TableB[Contrado] = TableA[Contrado] && TableB[Date] =_max ), TableB[TRAVA])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

thanks @amitchandak  for the help but it didn't work, I'll put the link to the power bi file with your suggestion. Could you please check?

https://drive.google.com/file/d/1Sm6jmkDKnbBpANWUrj3vzHO1sT0zfu4e/view?usp=sharing 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.