Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi power Bi community
I have two tables and I need to get data from one of them to the other.
The tables are called Data and chechkin.
In the data table I have a the following rows.
Index: (number)
Customer_id: (number)
Answer_date: (date)
The chechkin table have the following rows
Index: (number)
Customer_id: (number)
Chechkin_date: (date)
I want to make a lookup function where I find the last chechin_date in the chechkin_table with a date that comes before the answer date.
I have tried with this Dax:
LastChechIndate = lookupvalue('Checkin'[Chechkin_date], 'Checkin'[Customer_id], 'Data'[Customer_id])
The problem is that I get an error becuase the Dax returns multiple values. Can anyone help me with this issue?
All help is greatly appreciated.
Solved! Go to Solution.
Create a calculated column in the Data table to store the last Chechkin_date.
LastChechkinDate =
VAR CurrentCustomerID = 'Data'[Customer_id]
VAR CurrentAnswerDate = 'Data'[Answer_date]
RETURN
MAXX(
FILTER(
'Checkin',
'Checkin'[Customer_id] = CurrentCustomerID &&
'Checkin'[Chechkin_date] < CurrentAnswerDate
),
'Checkin'[Chechkin_date]
)
Create a calculated column in the Data table to store the last Chechkin_date.
LastChechkinDate =
VAR CurrentCustomerID = 'Data'[Customer_id]
VAR CurrentAnswerDate = 'Data'[Answer_date]
RETURN
MAXX(
FILTER(
'Checkin',
'Checkin'[Customer_id] = CurrentCustomerID &&
'Checkin'[Chechkin_date] < CurrentAnswerDate
),
'Checkin'[Chechkin_date]
)
Thanks for the answer.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |