Forum Discussion
GINMED
Helper III
4 years agoCorrect values per item
Hi, I'm using that one measure for getting correct values for first and last payment, but that one does not work for each item. How can I filter for each item ? var FirstPayment = MINX(ALLSELEC...
- Anonymous3 years ago
HI GINMED,
You can try to use the following measure formula if it helps:
KASKO_total = VAR firstP = CALCULATE ( MIN ( 'Project'[Sequence] ), ALLSELECTED ( 'Project' ), VALUES ( 'Project'[PL Nr.] ) ) VAR lastP = CALCULATE ( MAX ( 'Project'[Sequence] ), ALLSELECTED ( 'Project' ), VALUES ( 'Project'[PL Nr.] ) ) VAR CurrentSeq = SELECTEDVALUE ( 'Project'[Sequence] ) VAR CurrentP = SELECTEDVALUE ( 'Project'[KASKO] ) RETURN SWITCH ( CurrentSeq, firstP, 'Calculation'[kasko_first], lastP, 'Calculation'[kasko_last], CurrentP )Regards,
Xiaoxin Sheng
Anonymous
3 years agoNot applicable
Hi GINMED,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
GINMED
Helper III
3 years agoAnonymous there is my sample data
- Anonymous3 years agoNot applicable
HI GINMED,
You can try to use the following measure formula if it helps:
KASKO_total = VAR firstP = CALCULATE ( MIN ( 'Project'[Sequence] ), ALLSELECTED ( 'Project' ), VALUES ( 'Project'[PL Nr.] ) ) VAR lastP = CALCULATE ( MAX ( 'Project'[Sequence] ), ALLSELECTED ( 'Project' ), VALUES ( 'Project'[PL Nr.] ) ) VAR CurrentSeq = SELECTEDVALUE ( 'Project'[Sequence] ) VAR CurrentP = SELECTEDVALUE ( 'Project'[KASKO] ) RETURN SWITCH ( CurrentSeq, firstP, 'Calculation'[kasko_first], lastP, 'Calculation'[kasko_last], CurrentP )Regards,
Xiaoxin Sheng
- GINMED3 years ago
Helper III
Anonymous Thank you so much, this one works perfectly!!!