verneroberts
9 years agoAdvocate I
Selected value
Most reports I make have a dynamic header using the Enlighten Data Story where I have the title update to show which filter values the user has currently selected as they interact with the report.
Selected State =
VAR __allLabel = "The U.S."
VAR __maxCount = 5
VAR __maxLabel = "multiple states"
VAR __totalCount = CALCULATE(DISTINCTCOUNT('Table'[State]),ALL('Table'))
VAR __selectedCount = DISTINCTCOUNT('Table'[State])
RETURN
IF(
__selectedCount = 1,
VALUES('Table'[State]),
IF (
__selectedCount = __totalCount,
__allLabel,
IF (
__selectedCount > __maxCount,
__maxLabel,
CONCATENATEX(TOPN(__selectedCount-1,VALUES('Table'[State])),'Table'[State],", ") & " and " & LASTNONBLANK(VALUES('Table'[State]),true)
)
)
)
eyJrIjoiNTU2ZTM2MzgtZGNlMS00MGE2LTljNTEtMzc0ZDhkNzc2NDdkIiwidCI6Ijk0MjYwZjAzLTA3OTMtNDg0YS05MWNmLWJlYmU1ODQzMTliYyIsImMiOjEwfQ
No RepliesBe the first to reply