Forum Discussion
Comparison of First Index with the Second one
- 4 years ago
Hi GuestUser123 ,
According to your description, here's my solution.
My sample data is the same with yours.
Create a measure.
Check = IF ( MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[CustomerID] = MAX ( 'Table'[CustomerID] ) && 'Table'[Index] = 1 ), 'Table'[Payment] ) = MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[CustomerID] = MAX ( 'Table'[CustomerID] ) && 'Table'[Index] = 2 ), 'Table'[Payment] ), "Not change", "Change" )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi JirkaZ Thanks for the reply. However, I have only one table with me having all the above fields and I have to compare the first row with the second one to see if there has been any change in the Payment method.
- JirkaZ4 years ago
Solution Specialist
But you know you can abstract some other table from this one and do a proper modelling with many to one relationships etc., right?
- GuestUser1234 years agoRegular Visitor
Yes I can do that. However, could you please elaborate a bit more that even if I create another table from this one, do the data modelling as well.. But how will I pull only those rows where Index is more than 1 so that I could do a comparison on the Payment method for each Cust ID?
- JirkaZ4 years ago
Solution Specialist
as I said before - then you can loop through the master customer table and evaluate the ROWCOUNT of the RELATEDTABLE to see if the customer has multiple indexes.