Forum Discussion
Summarize a Table for Specific values in a column
I would like to show and add only IDs that are in 2008 . So will be adding all values except IDs like 9 and 4 that their date is not 2008 , and but will apply another date range filter at the end. Basicly using the Date=2008 as my indicator to select IDs.
here is my DAX but can't figure out how to filter the ID.
CALCULATETABLE(SUMMARIZE('Table',
[ID], "_sum",SUMX('Table',[VALUE])), FILTER('Table', [DATE] >= 2002 && [CLM_INC_DATE] <= 2008 ))
as you see in Summarized table 4 and 9 are removed from calculation becuase they never had date =2008.
NilR
Replace the correct table and column names as per your model and add the following measure: My Table is T17SUMX ( FILTER ( ADDCOLUMNS ( T17, "x2008", CALCULATE ( COUNTROWS ( T17 ), ALLEXCEPT ( T17, T17[ID] ), T17[DATE] = 2008 ) ), [x2008] = 1 && T17[DATE] >= 2002 && T17[DATE] <= 2008 ), T17[VALUE] )________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply π
3 Replies
- Fowmy
Super User
- Fowmy
Super User
NilR
Replace the correct table and column names as per your model and add the following measure: My Table is T17SUMX ( FILTER ( ADDCOLUMNS ( T17, "x2008", CALCULATE ( COUNTROWS ( T17 ), ALLEXCEPT ( T17, T17[ID] ), T17[DATE] = 2008 ) ), [x2008] = 1 && T17[DATE] >= 2002 && T17[DATE] <= 2008 ), T17[VALUE] )________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply π