Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I have two tables which have the same columns.
How can I write the below code to return values and look up against both tables?
1. Export Actions
2. Export Actions - History
Solved! Go to Solution.
HI @HenryJS ,
You can try to use the following measure formula to get distinct count from the merged table:
Candidate Calls =
VAR _list =
FILTER (
UNION (
SELECTCOLUMNS (
'Export Actions',
"UserName", [UserName],
"ActionName", [ActionName],
"ActionDate", [ActionDate],
"CandidateRef", [CandidateRef]
),
SELECTCOLUMNS (
'Export Actions - History',
"UserName", [UserName],
"ActionName", [ActionName],
"ActionDate", [ActionDate],
"CandidateRef", [CandidateRef]
)
),
[ActionName]
IN {
"Call - Check In",
"Call - Follow Up",
"Call - Proactive Approach",
"Call - Update"
}
)
RETURN
COUNTROWS ( SUMMARIZE ( _list, [CandidateRef] ) )
Regards,
Xiaoxin Sheng
HI @HenryJS ,
You can try to use the following measure formula to get distinct count from the merged table:
Candidate Calls =
VAR _list =
FILTER (
UNION (
SELECTCOLUMNS (
'Export Actions',
"UserName", [UserName],
"ActionName", [ActionName],
"ActionDate", [ActionDate],
"CandidateRef", [CandidateRef]
),
SELECTCOLUMNS (
'Export Actions - History',
"UserName", [UserName],
"ActionName", [ActionName],
"ActionDate", [ActionDate],
"CandidateRef", [CandidateRef]
)
),
[ActionName]
IN {
"Call - Check In",
"Call - Follow Up",
"Call - Proactive Approach",
"Call - Update"
}
)
RETURN
COUNTROWS ( SUMMARIZE ( _list, [CandidateRef] ) )
Regards,
Xiaoxin Sheng
You can Union the tables in memory in the DAX. Consider using SELECTCOLUMNS if it runs slow.
Candidate Calls =
var _uniontable = union(TableA, TableB)
RETURN
calculate(DISTINCTCOUNT(_uniontable ,'Export Actions'[ActionName] in {"Call - Check In","Call - Follow Up", "Call - Proactive Approach", "Call - Update"},'Export Actions'[ActionDate] )
Appreciate your Kudos
Connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
64 | |
50 | |
36 | |
26 |
User | Count |
---|---|
86 | |
55 | |
44 | |
43 | |
36 |