Forum Discussion
change text in legend
- 9 years ago
Hi swong,
It looks like there existing some rows in Table1 that aren't referenced to Start Month value in Table2. So, when you add [Start Month] in legend, (Blank) appears as a legend item. It is not available to rename the legend items, but you could try below workarounds.
In Table1, create a calculated column. In my test, I set the data type of Table2[Start Month] to text. If in your scenario, its data type should be date/time, then, you have to replace the "other Date" in below forlumn with a specific date value like Date(2017,1,1). In the chart, add Table1[Column] into legend area.
Column = IF ( RELATED ( Table2[Start Month] ) <> BLANK (), RELATED ( Table2[Start Month] ), "other Date" )
Alternatively, if you only want to show values whose corresponding start month is not blank, you could create a new table to filter out some rows. Then, please create chart based on this new table.
Table = ADDCOLUMNS ( CALCULATETABLE ( Table1, FILTER ( Table1, RELATED ( Table2[Start Month] ) <> BLANK () ) ), "Start Month Column", RELATED ( Table2[Start Month] ) )
Best regards,
Yuliana Gu
Hi swong,
It looks like there existing some rows in Table1 that aren't referenced to Start Month value in Table2. So, when you add [Start Month] in legend, (Blank) appears as a legend item. It is not available to rename the legend items, but you could try below workarounds.
In Table1, create a calculated column. In my test, I set the data type of Table2[Start Month] to text. If in your scenario, its data type should be date/time, then, you have to replace the "other Date" in below forlumn with a specific date value like Date(2017,1,1). In the chart, add Table1[Column] into legend area.
Column = IF ( RELATED ( Table2[Start Month] ) <> BLANK (), RELATED ( Table2[Start Month] ), "other Date" )
Alternatively, if you only want to show values whose corresponding start month is not blank, you could create a new table to filter out some rows. Then, please create chart based on this new table.
Table = ADDCOLUMNS ( CALCULATETABLE ( Table1, FILTER ( Table1, RELATED ( Table2[Start Month] ) <> BLANK () ) ), "Start Month Column", RELATED ( Table2[Start Month] ) )
Best regards,
Yuliana Gu
Thanks! The first solution worked perfectly.