Forum Discussion
Comparing Difference between two columns in two different tables
- 3 years ago
Hi Anonymous
Please create a dimension table that contains all ticket numbers. This can be created in power query or can be a calculated table using the following dax
Tickets =
DISTINCT (
UNION (
ALLNOBLANKROW ( Table1[Ticket Num] ),
ALLNOBLANKROW ( Table2[Ticket Num] )
)
)
then you apply the following measureDifference =
COALESCE (
SUMX (
VALUES ( Tickets[Ticket Num] ),
CALCULATE (
VAR Val1 =
SUM ( Table1[Value] )
VAR Val2 =
SUM ( Table1[Value] )
RETURN
IF ( Val1 <> BLANK () && Val2 <> BLANK (), Val2 - Val1 )
)
),
"No Match"
)
Hey there!
I believe this almost has it. But at the moment it is showing the same difference for each ticket number. Let me know if anything stands out to you as something that needs changing. Thanks for your help!
Anonymous
Have you created the relationship between the dimtable and the other two tables?
- Anonymous3 years agoNot applicable
That's what I was missing, thanks so much!