Once again, I am stuck on something and ask for your help!
I got this measure :
I have this pivot table that shows total sales by month :
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[TD]2015[/TD]
[/TR]
[TR]
[TD]01[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]02[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]03[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]04[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]850[/TD]
[/TR]
[TR]
[TD]05[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]06[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]07[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]08[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]09[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Right now, the 2012 colomn doesn't appear because of the isPast3Years in the Calculate but I do have transactions in the Sales table. I don't have any transaction in May 2015 and in the following months, obviously.
If I drag this measure instead :
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[TD]2015[/TD]
[/TR]
[TR]
[TD]01[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]02[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]03[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]04[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]850[/TD]
[/TR]
[TR]
[TD]05[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]06[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]07[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]08[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]09[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
What I am looking for is a measure that gives 0 for every blank months in 2015 but not for 2012. I don't want to see any year that is not in the past 3. Tried Countrows() and other stuff but I wasn't able to figure something out
Thank you!!!
I got this measure :
Code:
=CALCULATE (
SUM ( Sales[Sales] );
Calender[isPast3Years] = TRUE ()
)
I have this pivot table that shows total sales by month :
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[TD]2015[/TD]
[/TR]
[TR]
[TD]01[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]02[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]03[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]04[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]850[/TD]
[/TR]
[TR]
[TD]05[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]06[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]07[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]08[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]09[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Right now, the 2012 colomn doesn't appear because of the isPast3Years in the Calculate but I do have transactions in the Sales table. I don't have any transaction in May 2015 and in the following months, obviously.
If I drag this measure instead :
Code:
=IF ( ISBLANK ( [TotalSales] ); 0; [TotalSales] )
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2012[/TD]
[TD]2013[/TD]
[TD]2014[/TD]
[TD]2015[/TD]
[/TR]
[TR]
[TD]01[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]02[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]03[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]04[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]850[/TD]
[/TR]
[TR]
[TD]05[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]06[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]07[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]08[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]09[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]0[/TD]
[TD]1000[/TD]
[TD]1000[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
What I am looking for is a measure that gives 0 for every blank months in 2015 but not for 2012. I don't want to see any year that is not in the past 3. Tried Countrows() and other stuff but I wasn't able to figure something out
Thank you!!!