Forum Discussion

troyhimes's avatar
troyhimes
Icon for Resolver I rankResolver I
6 years ago
Solved

ADDCOLUMNS with a FILTER?

I would like to add a date filter to the ADDCOLUMNS function below, but I can't seem to get it right.  What structure do I use?   FILTER('Development Roll-up','Development Roll-up'[Date]< Date(2021...
  • Anonymous's avatar
    Anonymous
    6 years ago

    HI troyhimes ,

     

    Instead of Summarize Column, you can just try summarize.

    Let me know if that works

     

    ==
    ADDCOLUMNS (
    SUMMARIZE (
    FILTER (
    'Development Roll-up',
    'Development Roll-up'[Date]
    < DATE ( 2021, 1, 1 )
    ),
    'Development Roll-up'[Date],
    'Development Roll-up'[Area],
    'Development Roll-up'[Heading],
    'Development Roll-up'[Plan],
    'Development Roll-up'[Cost Code],
    'Development Roll-up'[Mining Desc],
    'Development Roll-up'[Development Tons]
    ),
    "Ft. Advance", [Sum of Ft. Advance],
    "11'x12' eq ft", [Sum of Eq ft 11'x12'],
    "13.5'x15' eq ft", [Sum of Eq ft 13.5'x15']
    )

     

     

    Regards,

    HN

     

     

  • Anonymous's avatar
    Anonymous
    6 years ago
    EVALUATE
    CALCULATETABLE(
    
    	ADDCOLUMNS (
    	    SUMMARIZE(
    		    'Development Roll-up',
    		    'Development Roll-up'[Date],
    		    'Development Roll-up'[Area],
    		    'Development Roll-up'[Heading],
    		    'Development Roll-up'[Plan],
    		    'Development Roll-up'[Cost Code],
    		    'Development Roll-up'[Mining Desc],
    		    'Development Roll-up'[Development Tons]
    	  	),
    	    "Ft. Advance", [Sum of Ft. Advance],
    	    "11'x12' eq ft", [Sum of Eq ft 11'x12'],
    	    "13.5'x15' eq ft", [Sum of Eq ft 13.5'x15']
    	),
    	
    	'Development Roll-up'[Date] < Date(2021, 1, 1)
    )

    Do the above and you're good to go. This is much easier to manipulate with filters than the solution based on SUMMARIZECOLUMNS.

     

    Best

    D