Hi,
I have a table of data that basically shows invoice lines. Each line has a sales value. I want to add a field that adds up all of the invoice lines and shows the total value on each row.
The following is a simple example:
Invoice No Turnover Invoice Total
ABC123 £100.00 £450.00
ABC123 £150.00 £450.00
ABC123 £200.00 £450.00
In Excel it would be easy to do this by using either SUMIF or SUMIFS.
How would I achieve the same using a measure in Power Pivot? I have attached a file that has some sample data in it.
Thanks
Bax
I had to Google a bit and learned something of it myself and came across the following post:
Solved: Re: DAX equivalent of =sumifs, based on row contex... - Microsoft Fabric Community
You can add the calculated column to your table with the following DAX expression:
=CALCULATE(SUM(Table_Data[Turnover]),FILTER(Table_Data,Table_Data[Sales Invoices] = EARLIER(Table_Data[Sales Invoices])))
Another one could be:
=SUMX(FILTER(Table_Data,Table_Data[Sales Invoices] = EARLIER(Table_Data[Sales Invoices])),Table_Data[Turnover])
Thanks for asking!