ALL SOFTWARE EXERCISES
- EXERCISES HOME PAGE (837)
- Access 2010 (66)
- Access VBA Macros (17)
- Advanced VBA (29)
- ASP.NET MVC (0)
- ASP.NET webforms - C# (25)
- ASP.NET webforms - VB (27)
- Excel 2010 (83)
- Excel 2013 (10)
- Excel VBA Macros (37)
- Power BI - Excel 2013 (25)
- Power BI - Excel 2016 (23)
- Power BI Desktop (26)
- PowerPivot 2010 (26)
- Report Builder 3.0 (42)
- SQL (153)
- SSAS - multidimensional (21)
- SSAS - tabular (29)
- SSIS Integration Services (18)
- SSRS Reporting Services (53)
- Visual Basic 2010 (42)
- Visual C Sharp 2010 (65)
- WPF - Visual C# (20)
POWERPIVOT 2010 EXERCISES
Exercise: Create and Use a Calendar Column for your Star Sign
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
The answer to the exercise will be included and explained if you attend the Wise Owl course listed below!
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
The idea behind this exercise is to create a pivot table showing how many dates there are for Pisces, as opposed to other star signs:
Pisces goes from 19th February to 19th March. It's only an approximation - if you're born on the cusp of Pisces and some other inferior star sign, things get tricky.
You can do this exercise in either Excel or SQL Server Managment Studio. Just follow the instructions under the appropriate heading below!
Create a calendar table for all of the dates in the year 2000:
The function used to give the star sign could be: =IF(MONTH([@Date]-19)=2,"Pisces","Inferior star sign") .
Save this workbook as Star signs. You must then close it down to import it into PowerPivot.
Use Other Data Sources to import this table, and then create the pivot table as shown above. Save this as Not all can be winners - Excel, and close this down.
Create a calendar table in Management Studio to hold the dates (you might as well do it within the MAM database). You could do this in script using:
CREATE TABLE tblStarSignDates(
[Date] datetime PRIMARY KEY,
Add in one row for each date in 2000. To save typing the rows in one by one, you could use something like:
-- start with 1st Jan 2000
DECLARE @curdate datetime = '20000101'
-- add dates one row at a time
WHILE @curdate <=>=>'20001231'
-- add a record for this date
INSERT INTO tblStarSignDates (
) VALUES (
WHEN Month(@curdate-19) = 2 THEN 'Pisces'
ELSE 'Inferior star sign'
-- go on to next date
SET @curdate = DateAdd(day,1,@curdate)
Import this table, and use it to create the pivot table as shown above. Save this as Not all can be winners - SQL, then close it down.