- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

DAX : How to SummarizeColumn with certain condition
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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])
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@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])
)

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
09-14-2024 02:00 PM | |||
10-03-2024 10:26 AM | |||
10-30-2024 11:30 AM | |||
11-22-2023 12:59 PM | |||
12-16-2024 06:20 AM |
User | Count |
---|---|
117 | |
99 | |
84 | |
53 | |
47 |