Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have the following DAX formula, where I have Table_1 and Table_2 connected by Key_Campaign.
I need to add column "save_date" from Table_2 to Table_1, filtering in Table_2 the following:
- Table_2'[catstock] = values starting with "SEA."
- Table_2'[labor] = value "Season Leaf"
Labor | Labor_Id | Valid |
Season Leaf | 55 | Yes |
Season Land | 58 | Yes |
Season Stat | 60 | No |
Solved! Go to Solution.
Hi, @Harvey85
Based on your description, I have created the following sample data:
Table_1:
Table_2:
Labor_Table:
The relationship between the tables is as follows:
I'm using the following DAX to filter the rows with Valid = Yes:
End_Date =
VAR _mediumtable =
SUMMARIZE (
FILTER ( 'Labor_Table', 'Labor_Table'[Valid] = "Yes" ),
'Labor_Table'[Labor_Id],
'Labor_Table'[Labor],
'Labor_Table'[Valid]
)
RETURN
MAXX (
FILTER (
'Table_2',
'Table_1'[Key_Campaign] = 'Table_2'[Key_Campaign]
&& CONTAINSSTRING ( 'Table_2'[catstock], "SEA." )
&& 'Table_2'[Labor_Id] = [Labor_Id]
),
'Table_2'[save_date]
)
In the variables, I use FILTER to filter out the rows with Valid=Yes. And use the summarize function to summarize, the main purpose is to get the corresponding row name so that this column can be used in MAXX.
The DAX execution result is as follows:
I've provided the PBIX file for this time below, and it would be great if it would help you.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Harvey85
Based on your description, I have created the following sample data:
Table_1:
Table_2:
Labor_Table:
The relationship between the tables is as follows:
I'm using the following DAX to filter the rows with Valid = Yes:
End_Date =
VAR _mediumtable =
SUMMARIZE (
FILTER ( 'Labor_Table', 'Labor_Table'[Valid] = "Yes" ),
'Labor_Table'[Labor_Id],
'Labor_Table'[Labor],
'Labor_Table'[Valid]
)
RETURN
MAXX (
FILTER (
'Table_2',
'Table_1'[Key_Campaign] = 'Table_2'[Key_Campaign]
&& CONTAINSSTRING ( 'Table_2'[catstock], "SEA." )
&& 'Table_2'[Labor_Id] = [Labor_Id]
),
'Table_2'[save_date]
)
In the variables, I use FILTER to filter out the rows with Valid=Yes. And use the summarize function to summarize, the main purpose is to get the corresponding row name so that this column can be used in MAXX.
The DAX execution result is as follows:
I've provided the PBIX file for this time below, and it would be great if it would help you.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
147 | |
85 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |