Forum Discussion

miguesnet's avatar
miguesnet
Frequent Visitor
6 years ago
Solved

Graph : Lines per category and Average line overall

Hi, 

 

Is there a way to add automatically on average line per month on a graph?

I have in this example a cost per site per month (5  sites )  and i would like to add a line with the average monthly cost

Thanks in advance for your help

 

  • Hi miguesnet ,

     

    I have created a sample for your reference, please check the following steps as below.

     

    1. Create a calculated table as below and make it related to our fact table.

    Table 2 = UNION(VALUES('Table (2)'[category]),{"avg"})

    2. Then we can achieve that by a measure.

    Measure = 
    IF (
        MAX ( 'Table 2'[category] ) = "avg",
        CALCULATE (
            AVERAGE ( 'Table (2)'[value] ),
            ALLEXCEPT ( 'Table (2)', 'Table (2)'[date] )
        ),
        SUM ( 'Table (2)'[value] )
    )
    

     

    For more details, please check the pbix as attached.

     

     

4 Replies