March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear friends,
I have data that need to summarize, but at one of its column, I needed to show the last date (maximum date) on the related key row.
The data is something like this :
and the expection is to summarize this ItemId, Quantity, CostAmount, which is the 2 last column is easy (just use SUM), but the TransDate I want to retrieve only the last date when quantity is positive, like this :
I tried like this ->
Invetory = ADDCOLUMNS(
SUMMARIZECOLUMNS('inventory data'[ItemId], "Qty", SUM('inventory data'[Quantity]), "Amount", SUM('inventory data'[Cost amount]) ),
"InflowDate", MAX('inventory data'[TramsDate])
)
But the date is not the date of related ItemId, but the Max date overall, not to mentioned I don't know where to put the condition of the Quantity should be > 0.
Thanks
Solved! Go to Solution.
@admin_xlsior , Try like
Invetory = ADDCOLUMNS(
SUMMARIZECOLUMNS('inventory data'[ItemId], "Qty", SUM('inventory data'[Quantity]), "Amount", SUM('inventory data'[Cost amount]) ),
"InflowDate", MAXX(filter('inventory data', [ItemId] = earlier([ItemId])),[TramsDate])
)
@admin_xlsior , Try like
Invetory = ADDCOLUMNS(
SUMMARIZECOLUMNS('inventory data'[ItemId], "Qty", SUM('inventory data'[Quantity]), "Amount", SUM('inventory data'[Cost amount]) ),
"InflowDate", MAXX(filter('inventory data', [ItemId] = earlier([ItemId])),[TramsDate])
)
User | Count |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |