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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors