Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Add total in line chart

Hello, I need to add total Line in line Chart, this nes total line dont change if filter country is selected. Thanks for your support.
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  Anonymous ,

     

    Thanks AUDISU  for sharing, I also have a method here:

    Here are the steps you can follow:

    1. Create calculated table.

     

    Table 2 =
    var _table1=
    DISTINCT('Table'[Country])
    var _table2=
    {"Total"}
    return
    UNION(
        _table1,_table2)

     

    2. Create measure.

     

    Measure =
    IF(
        MAX('Table 2'[Country]) = "Total",SUMX(FILTER(ALL('Table'),'Table'[Date]=MAX('Table'[Date])),'Table'[TotalSales]),SUMX(FILTER('Table','Table'[Country]=MAX('Table 2'[Country])&&'Table'[Date]=MAX('Table'[Date])),[TotalSales]))

     

     3. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly