Forum Discussion
matsahiro
Helper II
5 years agoDAX Calculating on Wrong Rows - Not Recognizing Join Relationship Properly
Hello, I'm trying to figure out why DAX isn't calculating properly on the right rows. I have this indicator made in DAX trying to show which accounts have different dates from previous and current da...
matsahiro
Helper II
5 years agoI ended up merging the two data tables on account name in query editor. Thank you for your help!
jameszhang0805
Resolver IV
5 years agoWelcome, that's my pleasure. I know you have solved the problem by yourself.
I just wanted to update the method of not having to build a common table and without relationships.
CorrectAccoutAmt =
VAR _CurrentTable =
CALCULATETABLE (
SUMMARIZE ( 'Current', 'Current'[Statement Date], 'Current'[Account] ),
ALLSELECTED ()
)
VAR _PreviousTable =
CALCULATETABLE (
SUMMARIZE ( 'Previous', Previous[Previous Date], 'Previous'[Account] ),
ALLSELECTED ()
)
VAR _CorrectAccount =
INTERSECT ( _CurrentTable, _PreviousTable )
VAR _Result =
CALCULATE (
SUM ( 'Current'[Amount] ),
KEEPFILTERS ( _CorrectAccount )
)
RETURN
_Result