Forum Discussion
MCacc
3 years agoHelper IV
Dynamic title from filter selection
Hello, I need to create a measure for a title to be put on a visual. The titel shows the values selected from a filter. The filter to be used is a Date format, a year to be exact. ...
- 3 years ago
Hi MCacc , try this:
- Create this measure:
Max_date = VAR MaxValue = CALCULATE ( MAX( Table1[Date].[Año] ), ALL(Table1[Date].[Año])) RETURN CONCATENATEX ( FILTER ( Table1, Table1[Date].[Año] = MaxValue ), MaxValue, " - " )- Create this measure:
Min_date = VAR MinValue = CALCULATE ( MIN ( Table1[Date].[Año] ), ALL(Table1[Date].[Año])) RETURN CONCATENATEX ( FILTER ( Table1, Table1[Date].[Año] = MinValue ), MinValue, " - " )- And last measure:
Result Selection = Var _count= COUNTROWS(VALUES(Table1[Date])) return IF (_count>2,[Min_date] & " - " & [Max_date], CONCATENATEX(Table1,Table1[Date].[Año],"-") )- The result:
I hope works it for you, best regards
Bifinity_75
3 years agoSolution Sage
Hi MCacc , try this:
- Create this measure:
Max_date =
VAR MaxValue =
CALCULATE ( MAX( Table1[Date].[Año] ), ALL(Table1[Date].[Año]))
RETURN
CONCATENATEX (
FILTER ( Table1, Table1[Date].[Año] = MaxValue ),
MaxValue,
" - "
)- Create this measure:
Min_date =
VAR MinValue =
CALCULATE ( MIN ( Table1[Date].[Año] ), ALL(Table1[Date].[Año]))
RETURN
CONCATENATEX (
FILTER ( Table1, Table1[Date].[Año] = MinValue ),
MinValue,
" - "
)
- And last measure:
Result Selection =
Var _count= COUNTROWS(VALUES(Table1[Date]))
return
IF (_count>2,[Min_date] & " - " & [Max_date],
CONCATENATEX(Table1,Table1[Date].[Año],"-")
)
- The result:
I hope works it for you, best regards
- MCacc3 years agoHelper IV
Thank you!!