Sql-server – Columns into rows and rows into columns

sql serversql-server-2008-r2

I need to do this table transformation, but its little hard for me.

I have original table wich looks like this

enter image description here

and i need to transform the table into this

enter image description here

How can i do that ?

Here i prepared example database http://sqlfiddle.com/#!3/0f324

Thank you for helping.

Best Answer

select * from 
(
select SubBrand,Month,Saless,Variable
 from 
(select * from DataTable
)as p
unpivot (Saless for Month in(January,February)) as u
) as p
pivot
(
min(Saless) for  Variable in ([Sales],[Promotion])
)as PP
order by SubBrand,Month