I am new to this DAX language and I am sure the solution isa very simple one, but I would appreciate some help.<o></o>
<o> </o>
I have created two measures. <o></o>
MAX MONTH=MONTH(MAX('MONTHLYSALES 002'[Date]))
2016 ADJ NET SALES-YTD= CALCULATE(SUM([ADJUSTED NET SALES]), 'MONTHLYSALES002'[CAL_YEAR]=2016,'MONTHLYSALES 002'[PERIOD]<=11)<o></o>
Which gives me the desired results in a Pivot table<o></o>
[TABLE="width: 582"]
<colgroup><col width="268" style="width: 201pt; mso-width-source: userset; mso-width-alt: 9801;"> <col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="4"> <col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <tbody>[TR]
[TD="class: xl68, width: 268"][/TD]
[TD="class: xl69, width: 103"]2016 ADJ NET SALES-TOTAL[/TD]
[TD="class: xl69, width: 103"]2016 ADJ NET SALES-YTD[/TD]
[TD="class: xl69, width: 103"]2017 ADJ NET SALES- YTD[/TD]
[TD="class: xl70, width: 103"]YTD % CHNG[/TD]
[TD="width: 97"]MAX MONTH[/TD]
[/TR]
[TR]
[TD="class: xl71"]FLEA & TICK[/TD]
[TD="class: xl65, align: right"]$34,273,033[/TD]
[TD="class: xl65, align: right"]$32,747,351[/TD]
[TD="class: xl67, align: right"]$34,925,113[/TD]
[TD="class: xl66, align: right"]6.7 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]HEALTH AND BEAUTY CARE[/TD]
[TD="class: xl65, align: right"]$7,262,615[/TD]
[TD="class: xl65, align: right"]$6,407,594[/TD]
[TD="class: xl67, align: right"]$8,012,576[/TD]
[TD="class: xl66, align: right"]25.0 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]FORMULATED TREATS[/TD]
[TD="class: xl65, align: right"]$6,379,316[/TD]
[TD="class: xl65, align: right"]$6,071,751[/TD]
[TD="class: xl67, align: right"]$5,327,003[/TD]
[TD="class: xl66, align: right"]-12.3 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]DENTAL[/TD]
[TD="class: xl65, align: right"]$1,103,680[/TD]
[TD="class: xl65, align: right"]$1,017,407[/TD]
[TD="class: xl67, align: right"]$1,022,124[/TD]
[TD="class: xl66, align: right"]0.5 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]ACCESSORIES AND TOYS[/TD]
[TD="class: xl65, align: right"]$229,835[/TD]
[TD="class: xl65, align: right"]$211,170[/TD]
[TD="class: xl67, align: right"]$195,077[/TD]
[TD="class: xl66, align: right"]-7.6 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]NATURAL TREATS[/TD]
[TD="class: xl65, align: right"]$33,044[/TD]
[TD="class: xl65, align: right"]$33,044[/TD]
[TD="class: xl67, align: right"]$26,584[/TD]
[TD="class: xl66, align: right"]-19.5 %[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="class: xl71"]WASTE MANAGEMENT & HOUSEBREAK[/TD]
[TD="class: xl65, align: right"]$31,189[/TD]
[TD="class: xl65, align: right"]$28,108[/TD]
[TD="class: xl67, align: right"]$11,783[/TD]
[TD="class: xl66, align: right"]-58.1 %[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="class: xl71"]RAWHIDE[/TD]
[TD="class: xl65, align: right"]$31,445[/TD]
[TD="class: xl65, align: right"]$31,445[/TD]
[TD="class: xl67, align: right"]$4,574[/TD]
[TD="class: xl66, align: right"]-85.5 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]Grand Total[/TD]
[TD="class: xl65, align: right"]$49,344,155[/TD]
[TD="class: xl65, align: right"]$46,547,870[/TD]
[TD="class: xl67, align: right"]$49,524,835[/TD]
[TD="class: xl66, align: right"]6.4 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
</tbody>[/TABLE]
<v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" oreferrelative="t" o:spt="75" coordsize="21600,21600"> <v:stroke joinstyle="miter"> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"> <v:f eqn="sum @0 1 0"> <v:f eqn="sum 0 0 @1"> <v:f eqn="prod @2 1 2"> <v:f eqn="prod @3 21600 pixelWidth"> <v:f eqn="prod @3 21600 pixelHeight"> <v:f eqn="sum @0 0 1"> <v:f eqn="prod @6 1 2"> <v:f eqn="prod @7 21600 pixelWidth"> <v:f eqn="sum @8 21600 0"> <v:f eqn="prod @7 21600 pixelHeight"> <v:f eqn="sum @10 21600 0"> </v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas> <vath o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"> <o:lock aspectratio="t" v:ext="edit"></o:lock></vath></v:stroke></v:shapetype><v:shape id="Picture_x0020_3" style="width: 468pt; height: 132.75pt; visibility: visible; mso-wrap-style: square;" type="#_x0000_t75" o:spid="_x0000_i1026"> <v:imagedata o:title="" src="file:///C:/Users/arundell/AppData/Local/Temp/msohtmlclip1/01/clip_image001.emz"></v:imagedata></v:shape>
But when I substitute the “11” with a filter and use the MaxMonth measure<o></o>
2016 ADJ NET SALES-YTD =CALCULATE(SUM([ADJUSTED NET SALES]), 'MONTHLYSALES 002'[CAL_YEAR]=2016,filter ('MONTHLYSALES 002', [PERIOD] <= [MAX MONTH]))<o></o>
I get the below results.<o></o>
[TABLE="width: 582"]
<colgroup><col width="268" style="width: 201pt; mso-width-source: userset; mso-width-alt: 9801;"> <col width="103" style="width: 77pt; mso-width-source: userset; mso-width-alt: 3766;" span="4"> <col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <tbody>[TR]
[TD="class: xl68, width: 268"][/TD]
[TD="class: xl69, width: 103"]2016 ADJ NET SALES-TOTAL[/TD]
[TD="class: xl69, width: 103"]2016 ADJ NET SALES-YTD[/TD]
[TD="class: xl69, width: 103"]2017 ADJ NET SALES- YTD[/TD]
[TD="class: xl70, width: 103"]YTD % CHNG[/TD]
[TD="width: 97"]MAX MONTH[/TD]
[/TR]
[TR]
[TD="class: xl71"]FLEA & TICK[/TD]
[TD="class: xl65, align: right"]$34,273,033[/TD]
[TD="class: xl65, align: right"]$34,273,033[/TD]
[TD="class: xl67, align: right"]$34,925,113[/TD]
[TD="class: xl66, align: right"]1.9 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]HEALTH AND BEAUTY CARE[/TD]
[TD="class: xl65, align: right"]$7,262,615[/TD]
[TD="class: xl65, align: right"]$7,262,615[/TD]
[TD="class: xl67, align: right"]$8,012,576[/TD]
[TD="class: xl66, align: right"]10.3 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]FORMULATED TREATS[/TD]
[TD="class: xl65, align: right"]$6,379,316[/TD]
[TD="class: xl65, align: right"]$6,379,316[/TD]
[TD="class: xl67, align: right"]$5,327,003[/TD]
[TD="class: xl66, align: right"]-16.5 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]DENTAL[/TD]
[TD="class: xl65, align: right"]$1,103,680[/TD]
[TD="class: xl65, align: right"]$1,103,680[/TD]
[TD="class: xl67, align: right"]$1,022,124[/TD]
[TD="class: xl66, align: right"]-7.4 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]ACCESSORIES AND TOYS[/TD]
[TD="class: xl65, align: right"]$229,835[/TD]
[TD="class: xl65, align: right"]$229,835[/TD]
[TD="class: xl67, align: right"]$195,077[/TD]
[TD="class: xl66, align: right"]-15.1 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]NATURAL TREATS[/TD]
[TD="class: xl65, align: right"]$33,044[/TD]
[TD="class: xl65, align: right"]$33,044[/TD]
[TD="class: xl67, align: right"]$26,584[/TD]
[TD="class: xl66, align: right"]-19.5 %[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="class: xl71"]WASTE MANAGEMENT & HOUSEBREAK[/TD]
[TD="class: xl65, align: right"]$31,189[/TD]
[TD="class: xl65, align: right"]$31,189[/TD]
[TD="class: xl67, align: right"]$11,783[/TD]
[TD="class: xl66, align: right"]-62.2 %[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="class: xl71"]RAWHIDE[/TD]
[TD="class: xl65, align: right"]$31,445[/TD]
[TD="class: xl65, align: right"]$31,445[/TD]
[TD="class: xl67, align: right"]$4,574[/TD]
[TD="class: xl66, align: right"]-85.5 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD="class: xl71"]Grand Total[/TD]
[TD="class: xl65, align: right"]$49,344,155[/TD]
[TD="class: xl65, align: right"]$49,344,155[/TD]
[TD="class: xl67, align: right"]$49,524,835[/TD]
[TD="class: xl66, align: right"]0.4 %[/TD]
[TD="align: right"]11[/TD]
[/TR]
</tbody>[/TABLE]
<vval id="Oval_x0020_5" style="width: 66.75pt; height: 22.5pt; margin-top: 115.9pt; margin-left: 228.75pt; visibility: visible; position: absolute; z-index: 251659264; mso-wrap-style: square; mso-width-percent: 0; mso-height-percent: 0; mso-wrap-distance-left: 9pt; mso-wrap-distance-top: 0; mso-wrap-distance-right: 9pt; mso-wrap-distance-bottom: 0; mso-position-horizontal: absolute; mso-position-horizontal-relative: text; mso-position-vertical: absolute; mso-position-vertical-relative: text; mso-width-relative: margin; mso-height-relative: margin; v-text-anchor: middle;" filled="f" o:spid="_x0000_s1026" strokeweight="2pt" strokecolor="red" o:gfxdata="UEsDBBQABgAIAAAAIQC75UiUBQEAAB4CAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKSRvU7DMBSF
dyTewfKKEqcMCKEmHfgZgaE8wMW+SSwc27JvS/v23KTJgkoXFsu+P+c7Ol5vDoMTe0zZBl/LVVlJ
gV4HY31Xy4/tS3EvRSbwBlzwWMsjZrlprq/W22PELHjb51r2RPFBqax7HCCXIaLn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AAP//
AwBQSwECLQAUAAYACAAAACEAu+VIlAUBAAAeAgAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRf
VHlwZXNdLnhtbFBLAQItABQABgAIAAAAIQCtMD/xwQAAADIBAAALAAAAAAAAAAAAAAAAADYBAABf
cmVscy8ucmVsc1BLAQItABQABgAIAAAAIQAhiDh7vgIAAGUGAAAfAAAAAAAAAAAAAAAAACACAABj
bGlwYm9hcmQvZHJhd2luZ3MvZHJhd2luZzEueG1sUEsBAi0AFAAGAAgAAAAhAOFRNx/PBgAA5hsA
ABoAAAAAAAAAAAAAAAAAGwUAAGNsaXBib2FyZC90aGVtZS90aGVtZTEueG1sUEsBAi0AFAAGAAgA
AAAhAJxmRkG7AAAAJAEAACoAAAAAAAAAAAAAAAAAIgwAAGNsaXBib2FyZC9kcmF3aW5ncy9fcmVs
cy9kcmF3aW5nMS54bWwucmVsc1BLBQYAAAAABQAFAGcBAAAlDQAAAAA=
"><v:shape id="Picture_x0020_4" style="width: 468pt; height: 132.75pt; visibility: visible; mso-wrap-style: square;" type="#_x0000_t75" o:spid="_x0000_i1025"> <v:imagedata o:title="" src="file:///C:/Users/arundell/AppData/Local/Temp/msohtmlclip1/01/clip_image004.emz"></v:imagedata></v:shape><o></o></vval>
I want to be able to use the Max Month measure which isautomated, but get the results in the first table. What am I doing wrong?
THANKS FOR THE HELP