Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I've got a table with multiple rows by invoices, overyone with invoice quantity and invoice date.
I need to sum invoice quantity by date to get something like this:
And after that get an unique value of the average of every row.
How can i do it?
Solved! Go to Solution.
@marcss44 , Try using
dax
SumInvoiceQuantity =
SUMX(
SUMMARIZE(
Table1,
Table1[Fecha],
"TotalQuantity", SUM(Table1[Cantidad])
),
[TotalQuantity]
)
If this still doesn't work, you can try breaking it down into two separate measures to make it easier to debug:
Create a measure to calculate the total quantity per date:
dax
TotalQuantityPerDate =
SUMMARIZE(
Table1,
Table1[Fecha],
"TotalQuantity", SUM(Table1[Cantidad])
)
And one more for
dax
SumInvoiceQuantity =
SUMX(
TotalQuantityPerDate,
[TotalQuantity]
)
Proud to be a Super User! |
|
@marcss44 Create a new measure in Power BI to sum the invoice quantity by date. You can use the SUM function along with GROUP BY to achieve this.
DAX
SumInvoiceQuantity =
SUMX(
SUMMARIZE(
'YourTable',
'YourTable'[InvoiceDate],
"TotalQuantity", SUM('YourTable'[InvoiceQuantity])
),
[TotalQuantity]
)
Create another measure to calculate the average of the summed quantities.
DAX
AverageOfSumInvoiceQuantity =
AVERAGEX(
SUMMARIZE(
'YourTable',
'YourTable'[InvoiceDate],
"TotalQuantity", SUM('YourTable'[InvoiceQuantity])
),
[TotalQuantity]
)
Proud to be a Super User! |
|
I've used for this for the first part:
@marcss44 , Try using
dax
SumInvoiceQuantity =
SUMX(
SUMMARIZE(
Table1,
Table1[Fecha],
"TotalQuantity", SUM(Table1[Cantidad])
),
[TotalQuantity]
)
If this still doesn't work, you can try breaking it down into two separate measures to make it easier to debug:
Create a measure to calculate the total quantity per date:
dax
TotalQuantityPerDate =
SUMMARIZE(
Table1,
Table1[Fecha],
"TotalQuantity", SUM(Table1[Cantidad])
)
And one more for
dax
SumInvoiceQuantity =
SUMX(
TotalQuantityPerDate,
[TotalQuantity]
)
Proud to be a Super User! |
|
Hi @marcss44 Try these please
Create a Date-Sum Table:
SumByDate =
SUMMARIZE(
'Table',
'Table'[Date],
"TotalQuantity", SUM('Table'[Quantity])
)
Calculate the Average of Sums:
AverageSumByDate =
AVERAGEX(
SUMMARIZE(
'Table',
'Table'[Date],
"TotalQuantity", SUM('Table'[Quantity])
),
[TotalQuantity]
)
If this post helped please do give a kudos and accept this as a solution
Thanks In Advance
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
91 | |
73 | |
58 | |
42 | |
41 |
User | Count |
---|---|
100 | |
63 | |
56 | |
48 | |
45 |