Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How may I create a slicer with dynamic text

I have a visual where I dynamically add line plots to the visual using the following code:

VAR LogicTest = 
COUNTROWS(DISTINCT(
	FILTER(
		ALLSELECTED(_measuretable[Column1]),
		_measuretable[Column1] = "-1"
		)
)) = 1
RETURN
IF(
	LogicTest,     
 	CALCULATE(AVERAGE(data[Price]), dateadd(data[currentYearMonth], -1, YEAR)) -  CALCULATE(average(data[Price]), DATEADD(data[currentYearMonth],-1,YEAR)),
    BLANK()
)

The _measuretable only contains the text rows "-1", "-2" for displaying data for previous year 1, 2 and so on. Is there any way to dynamically create text inside this table. I am thinking something like txt1 = 

selection_1_txt = SELECTEDVALUE(data1[currentyear])-1) & "-" & SELECTEDVALUE(data2[currentyear])-1)

 

 

1 Reply

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Icon for Community Support rankCommunity Support

    Anonymous 

     

    This is not supported. Values in a calculated table are fixed.