Forum Discussion
Iterate through filter values
- Anonymous8 years ago
Hi,
I would probably first declare a variable that is a table of all valid birth years for the combination of slicers.
Then I would see if the birth year for the currently displayed person (for example in a table visual) exists in the list of valid years.Example measure could be something like this:
Show =
VAR Validyears =
SELECTCOLUMNS (
ADDCOLUMNS (
CROSSJOIN ( VALUES ( SelectAge[Age] ); VALUES ( Years[Years] ) );
"ValidYear"; [Years] - [Age]
);
"ValidYear"; [ValidYear]
)
RETURN
IF (
COUNTROWS ( INTERSECT ( VALUES ( Person[Birthyear] ); Validyears ) ) > 0;
1;
BLANK ()
)Br,
Magnus
Hi,
I would probably first declare a variable that is a table of all valid birth years for the combination of slicers.
Then I would see if the birth year for the currently displayed person (for example in a table visual) exists in the list of valid years.
Example measure could be something like this:
Show =
VAR Validyears =
SELECTCOLUMNS (
ADDCOLUMNS (
CROSSJOIN ( VALUES ( SelectAge[Age] ); VALUES ( Years[Years] ) );
"ValidYear"; [Years] - [Age]
);
"ValidYear"; [ValidYear]
)
RETURN
IF (
COUNTROWS ( INTERSECT ( VALUES ( Person[Birthyear] ); Validyears ) ) > 0;
1;
BLANK ()
)
Br,
Magnus
Excellent, works like a charm. Thanks a bunch!