Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Average - But need to sum first

Hi,

 

Third time I write this topic.. Website is not helping me out today, haha. Hopefully you guys can 🙂

I need to calculate the average after a sum of the invoices.

Sample below:

 

AmountInvoice Number ACTUAL INVOICE AMOUNT
€ 100.0019700091  
€ 200.0019700091  
€ 150.0019700091 250
€ 250.0019700091  
€ 10.0019700095  
€ 20.0019700095 20
€ 30.0019700095  
€ 5.0019700100  
€ 10.0019700100  
€ 20.0019700100 15
€ 20.0019700100  
€ 10.0019700100  
Average: 68,75  Average: 95


What I need is 95 as outcome, but currently I have 68,75. How do I fix this? I suppose it's easy but I can't get my head around it.


Thank you in advance for helping me out!
Below is my measure:

 

1. Factuur Gemiddelde = 
CALCULATE(
    //Average berekening
    AVERAGEX(
        SUMMARIZE(TransactionLinesBulk,TransactionLinesBulk[InvoiceNumber], TransactionLinesBulk[Bedrag]),
        TransactionLinesBulk[Bedrag]),
        //Filters
            LEFT(GLAccountClass[ClassificationCode],4)="WOmz",
            TransactionLinesBulk[InvoiceNumber] > 0,
            TransactionLinesBulk[Bedrag] <> 0
)

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

averageX(summarize(Table,table[Invoice Number], "_1",sum(Table[Amount])),[_1])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

averageX(summarize(Table,table[Invoice Number], "_1",sum(Table[Amount])),[_1])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi @amitchandak ,

 

Thanks! Works like a charm. Can you explain what the _1 is and why it works like that?

@Anonymous , it is new column name inside summarize 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.