Forum Discussion

HansZuijd's avatar
HansZuijd
Regular Visitor
3 years ago
Solved

Merge multiple selected slicer items in a string

Hi,

i've created the below slicer and want to display the selected items on a card. the output should look something like "2017 (Q3, Q4), 2018, 2019, 2020 (Q1)"

any ideas on how to realise this?

kind regards, 

Hans

 

  • Try

    Selected Quarters
    VAR SummaryTable =
    	SUMMARIZE( 'Date', 'Date'[Year], 'Date'[Quarter] )
    Var Txt = CONCATENATEX( VALUES('Date'[Year]),
    	VAR Yr = 'Date'[Year]
    	VAR Qrs = CONCATENATEX(
    		FILTER( SummaryTable, 'Date'[Year] = Yr),
    		'Date'[Quarter],
    		", "
    	)
    	RETURN Yr & " ( " & Qrs & ")",
    	", "
    )
    RETURN Txt 

2 Replies

  • HansZuijd , Not exact the same but you can try something like this example

     

    concatenatex(Date, Date[Quarter] & "-" Date[Year], " , " )

  • Try

    Selected Quarters
    VAR SummaryTable =
    	SUMMARIZE( 'Date', 'Date'[Year], 'Date'[Quarter] )
    Var Txt = CONCATENATEX( VALUES('Date'[Year]),
    	VAR Yr = 'Date'[Year]
    	VAR Qrs = CONCATENATEX(
    		FILTER( SummaryTable, 'Date'[Year] = Yr),
    		'Date'[Quarter],
    		", "
    	)
    	RETURN Yr & " ( " & Qrs & ")",
    	", "
    )
    RETURN Txt