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
drivas771994
Helper II
Helper II

Creating a calculated measurement with data from different tables and days

Hi,

 

I'm trying to create a calculation where I can create a ratio between bodyweight and performance in exercises

I currently have two seperate tables. One with bodyweights that are collected on a weekly basis and another where there exercise weights put in on a daily basis. The main issue I have is that the dates don't line up well for example: I have a weight recorded on Monday 5/23/22 and then the exercise was done on Wednesday 5/25/22. Is there a way I can get power bi to find the weight from the nearest date and create a bodyweight ratio to the weight moved?

2 REPLIES 2
drivas771994
Helper II
Helper II

I ran it and it is giving me the date from which the most recent bodyweight is. The date is accurate, I need the actual bodyweight. Here was my dax formula: 

Most Recent Body Mass =

var dateweight=selectedvalue(SPARTA_SCANS2[Date])

return

calculate(min(TESTS[Date]), TESTS[Date]>=dateweight)

 

Rank Question Follow up.PNG

Anonymous
Not applicable

Hello

 

First create a date table and link both tables.

 

Second create this measure

weight=

var dateweight=selectedvalue(weight(date))

return

calculate(min(exercice[Date]), exercice[Date]>=dateweight)

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.