Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Chart Titles that adjust to the drill down layer

Hi All,   I have a chart that displays Invoicing by Month.   At the upper most level, the title is fine. Invoicing by Month. The report is designed to be for Financial YTD only, so will onl...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi Anonymous,

     

    The blog which BhaveshPatel provided is use card visual and slicer to achieve the dynamic title.

    Hide the default title, and get the select value from slicer, then deal with these data and convert them to specify format.

     

    For example.

     

    Measure:

    SelectValue =
    var selected= ALLSELECTED(Cycle[DayOfWeek])
    var leftPart=CONCATENATEX(TOPN(COUNTROWS(selected)-1,selected),[DayOfWeek]&",")//use topn and countrow to remove last record
    var rightPart=EXCEPT(selected,TOPN(COUNTROWS(selected)-1,selected))//use except function to get the last record
    var resultString= LEFT(leftPart,LEN(leftPart)-1)&" And "&rightPart//merge left part and right part
    Return
    "Dynamic title by "&if( COUNTROWS(selected)=1,ALLSELECTED(Cycle[DayOfWeek]),resultString)//check select records' count, if selected records' count greater or equal than 2, use merged result string

     

     

    Create a card visual and drag this measure to it, then turn off the category label.

     

    Create a slicer to choose the display value.

     

    Drag the card visual ot left top corner of the chart.

     

    Click on slicer to change the result string.

     

    Reference of Dax function:

    DAX Function Reference

     

    LEFT Function (DAX)

    RIGHT Function (DAX)

    LEN Function (DAX)

    ALLSELECTED Function (DAX)

    CONCATENATEX Function (DAX)

    TOPN Function (DAX)

    EXCEPT Function (DAX)

     

    Regards,

    Xiaoxin Sheng