Forum Discussion
Filter on colummn
- Anonymous7 years ago
Hi tonie_tollig,
According to your description, I think you want to replace result based on current row number, right? (if current row is last row, output last row 'input value' otherwise out first row 'input value')
If this is a case, you can add index column in query edit and use following measure to achieve your requirement:
Measure = VAR _current = MAX ( Table1[Index] ) VAR _min = MINX ( ALLSELECTED ( Table1[Index] ), [Index] ) VAR _max = MAXX ( ALLSELECTED ( Table1[Index] ), [Index] ) RETURN IF ( _current = _max, CALCULATE ( MAX ( Table1[Input Value] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = _max ) ), CALCULATE ( MIN ( Table1[Input Value] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = _min ) ) )Regards,
Xiaoxin Sheng
I am still not clear. Someone else who understand your question will help.
| Attr A | Input Value | Required Measure |
| Attr A1 | Value 1 | Value 1 |
| Attr A2 | Value 2 | Value 1 |
| Attr A3 | Value 3 | Value 1 |
| Attr A4 | Value 1 | |
| Attr A5 | Value 1 | |
| Attr A6 | Value 4 | Value 4 |
- Anonymous7 years agoNot applicable
Hi tonie_tollig,
According to your description, I think you want to replace result based on current row number, right? (if current row is last row, output last row 'input value' otherwise out first row 'input value')
If this is a case, you can add index column in query edit and use following measure to achieve your requirement:
Measure = VAR _current = MAX ( Table1[Index] ) VAR _min = MINX ( ALLSELECTED ( Table1[Index] ), [Index] ) VAR _max = MAXX ( ALLSELECTED ( Table1[Index] ), [Index] ) RETURN IF ( _current = _max, CALCULATE ( MAX ( Table1[Input Value] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = _max ) ), CALCULATE ( MIN ( Table1[Input Value] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = _min ) ) )Regards,
Xiaoxin Sheng
- tonie_tollig7 years agoFrequent Visitor
Thanks, very intersting way in solving the problem:smileyhappy: