Goal:
Currently custom expressions in calculated columns cannot refer to filtering schemes to find out whether a given row is filtered in or out. Also custom expressions in visualisations can only refer to their visualisation's filtering schema (as the expression will on be evaluated on top of that). With this enhancement developers would have the complete freedom of interacting with filtering schemes in custom expressions, including (but not limited to):
Implementation idea:
A new function which could be used in customs expression. It would accept one input (string), which would be the name of the filtering scheme. The return value would be a boolean, true if the given row is not filtered out by the given filtering scheme, and false if the row is filtered out. Ie:
Obviously the result of the function would need to be updated dynamically, so as soon as the filter values are changing, the custom expression which refers to the given filtering scheme would need to be re-evaluated.
Update:
The take this idea one step further: a second optional parameter for the new function which would be the name of the column for which the filter status we are interested in. An example:
Fruit | Count | Filtered rows | Filtered fruits |
Apple | 10 | true | true |
Apple | 5 | false | true |
Banana | 10 | false | false |
Orange | 8 | false | false |
The above results are with the following filter settings:
Fruit column: filtered to show "Apple" only
Count column: filtered to show "10" only
"Filtered rows" is a calculated column with the following expression: FilteredRows("FilteringScheme")
"Filtered fruits" is a calculated column with the following expression: FilteredRows("FilteringScheme","Fruit")
now that i'm able to edit the post I've added the above comments into the initial post
related idea which could also be achieved if my idea would be implemented:
SPF-I-59 - Update Calculated Column when filtering changes
the table has been truncated unfortunately. The custom expression for the second calculated column is as follows: FilteredRows("FilteringScheme","Fruit")
The take this idea one step further (I just can't edit my own idea): a second optional parameter for the new function which would be the name of the column for which the filter status we are interested in. An example:
FilteredRows("FilteringScheme")
FilteredRows("FilteringScheme","Fruit")
The above results are with the following filter settings:
Fruit column: filtered to show "Apple" only
Count column: filtered to show "10" only