Forum Discussion
New Table Aggregating Column
- 4 years ago
Issue is being caused by an empty string in Parent ID.
Try
SummaryTable = ADDCOLUMNS ( CALCULATETABLE ( DISTINCT( OriginalTable[Parent ID] ), NOT OriginalTable[Parent ID] = "" ), "Cost", CALCULATE ( SUM(OriginalTable[Cost] ) ) )BLANK function (DAX) - DAX | Microsoft Docs states
Some DAX functions treat blank cells somewhat differently from Microsoft Excel. Blanks and empty strings ("") are not always equivalent, but some operations may treat them as such. - 4 years ago
To use more than one column use SUMMARIZE instead.
SummaryTable = ADDCOLUMNS ( CALCULATETABLE ( SUMMARIZE( OriginalTable, OriginalTable[Parent ID], OriginalTable[Column 2] ), NOT OriginalTable[Parent ID] == "" ), "Cost", CALCULATE ( SUM(OriginalTable[Cost] ) ) )
I'm actually confused as to why NOT ISBLANK( OriginalTable[Parent ID] ) doesn't work! Can't find any reference as to when BLANK() == "" and when it doesn't.
Hi,
You can create a simple table visual by dragging the Parent column and writing this measure
Measure = sum(Data[Cost])
Hope this helps.
- Anonymous4 years agoNot applicable
A lot more complicated than that unfortunately. I have 4 master data management tables that join on custom keys with values such as # of points. When I do a measure based on the joined value, it multiplies it by the number of child tasks and the totals dont add up, and as they say, the best way to stop that from happening is to bring them in as columns, which is why I was trying to create a single table with all of the costs tied to the parents and then go from there.