Forum Discussion
chotu27
Post Patron
8 years agoGet Previous record
Hi All, I wanted to find previous record in matrix visual based on hierachy displayed below. Any Help with DAX please help me
TomMartens
Super User
8 years agoHey,
to compare score with previous score just create this measure (assuming both are measures):
Compare=
SUMX('yourtablename'
,IF([score] > [previous score], 1, 0)
)
If one or both are columns replace the reference with the following:
SUM('yourtablename'[score])
You may have to enclose the above into a CALCULATE(...)
Regards
Tom
to compare score with previous score just create this measure (assuming both are measures):
Compare=
SUMX('yourtablename'
,IF([score] > [previous score], 1, 0)
)
If one or both are columns replace the reference with the following:
SUM('yourtablename'[score])
You may have to enclose the above into a CALCULATE(...)
Regards
Tom
- chotu278 years ago
Post Patron
I am not asking about comparison . I asking how to find previous record column to do comparison
- TomMartens8 years ago
Super User
Hey,
can you please provide some sample data, that we can easily copy to Power BI and also provide how var1 to varn is sorted, are there possiblities that there are var1 and var3 in a group and for this group var1 provides the previous data for var3?
Regards
Tom