Forum Discussion

Jose_Spain's avatar
Jose_Spain
New Member
5 years ago
Solved

I need help! Average.

Good morning

I'm a basic Power Bi user and I need help. I have an excel file with data and I have created in power BI an array with customers (rows) and months of the year (columns) with the values of the orders that they have placed throughout the year. I need that matrix to add a colunma at the end next to the "total" column where I average every month and by customer.

Attach an image of what the table is like:

Thanks a lot.

Tabla.JPG

3 Replies

    • Jose_Spain's avatar
      Jose_Spain
      New Member

      Thank you very much for your help, but I see that the hybrid table is quite complicated to create and I do not know very well how to do it. Is there some other simpler way?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Jose_Spain ,

     

    Sample data is this.

    DateValueCustomer

    Wednesday, January 1, 20201A
    Sunday, February 2, 20202A
    Tuesday, March 3, 20203A
    Saturday, April 4, 20204A
    Tuesday, May 5, 20205A
    Saturday, June 6, 20206A
    Tuesday, July 7, 20207A
    Saturday, August 8, 20208A
    Wednesday, September 9, 20209A
    Saturday, October 10, 20204A
    Wednesday, November 11, 20206A
    Saturday, December 12, 20204A
    Tuesday, January 1, 20191A
    Saturday, February 2, 20191A
    Wednesday, January 1, 20201B
    Sunday, February 2, 20202B
    Tuesday, March 3, 20203B
    Saturday, April 4, 20201B
    Tuesday, May 5, 20205B
    Saturday, June 6, 20204B
    Tuesday, July 7, 20207B
    Saturday, August 8, 20208B
    Wednesday, September 9, 20209B
    Saturday, October 10, 20206B
    Wednesday, November 11, 20201B
    Saturday, December 12, 20202B
    Tuesday, January 1, 20193B
    Thursday, April 4, 20195B

     

    1.Create a calculated column.

     

    Month = FORMAT([Date],"MMMM")

     

     

    2.Create a new table by entering data. The Index column is to sort the Month column.

     

    3.Create a measure.

     

    Measure = IF(MAX('Month'[Month])in VALUES('Table'[Month]),CALCULATE(SUM('Table'[Value]),FILTER('Table',[Month]=MAX('Month'[Month]))),IF(MAX('Month'[Month])="Average",AVERAGE('Table'[Value])))

     

     

    4.The result is this, you can filter by year.

     

     

    You can check more details from here.

     

     

     

    Best Regards,

    Stephen Tao

     

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