Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Animated line chart show only one value

Dear friend I tried to use the "Play Axis" visual , it should display progressive with historical data but it only displays one value at a time. how can I fix it? what I need     
  • MFelix's avatar
    5 years ago

    Hi Anonymous ,

     

    Create a disconnected table with the values of your play axis and then add the following measure to your line chart and use the new table to the Axis:

    TotalSales =
    IF (
        SELECTEDVALUE ( 'YearPlayAxisTable'[Year] ) >= MAX ( 'Table'[Year] ),
        SUM ( 'Table'[Value] ),
        IF (
            COUNTROWS ( ALL ( 'YearPlayAxisTable'[Year] ) )
                <= COUNTROWS ( ALLSELECTED ( 'YearPlayAxisTable'[Year] ) ),
            SUM ( 'Table'[Value] )
        )
    )

     

    If you want to keep the chart with all the year shown enter a measure like this:

    FlatLine = 0

     

    For this line set the line size has 0 and the data labels off

     

    Result below and in attach PBIX file:

     

    If you want you can change the flat line by another value to get it more dinamic and don't set the y-axis maximum and minimum.