dinsdag 21 juni 2016

Error : This PivotTable report is invalid

Introduction

I was struggling with a problem with a PivotTable in Excel for hours. Although I can't exactly pinpoint the source of the problem, I would like to share this problem and a possible solution with you.

The Problem

The situation is that I have a workbook with multiple sheets and every sheets shows another view of the data, for instance from a product hierarchy and a customer hierarchy. Now, the client wanted to use slicers to select all the pivot tables and pivot charts on multiple sheets in the workbook. I have shown the situation below.


Now the real pain. The following error messages kept on coming everything I tried : "This PivotTable report is invalid. Try refreshing the Data...".


It seems a problem in Excel and not PowerPivot that is running in the back.

The solution

After trying to turn off the reportconnections (and not succeeding), I decided to remove the second tabsheet and start from scratch and right away the problems vanished.


As a side effect the other slicers performed a lot better now.

Update 04-06-2016 (NL) : Today I ran again into this error. Now this time deleted a hierarchy that was in the pivottable and put it it back again and it works again. May be the cause could be that I was editing the underlying query in PowerPivot .

Conclusion

Cross selecting (Rob Collie already used cross filtering in another context) with the slicers to multiple pivot tables can be a real pain. So don't make it too complex or you'll end in a swamp of errors in Excel.

Greetz,
Hennie


woensdag 15 juni 2016

What is Github?

Introduction

GitHub is a code hosting platform for version control and for collaboration. You can work together on projects from any place you want. Now once in a while, I'm using Github for working on my R skills For exercises in the course I need to create and maintain a Github repository. A repository is a usually a project and it can contain files and folders.

Now as I said, I'm not an user that often uses Github and therefore I wrote this blog. There are a couple of steps that you have to do in order to check in your code, in short:
  1. Create the Github account.
  2. Install the Github Desktop.
  3. Create a repository.
  4. Copy the files in the Github folder.
  5. Commit the code.
  6. Sync the code with Github.com
Commit and syncing,  I do find a bit confusing: Commit is saving the code in your project and syncing is syncing the commited code with Github.com. Let's keep that in mind.


Working with Github

Now if you create a repository a folder is created. this one is for the course Reproducible research R on Coursera.


Opening github desktop will show the files and code in the github folder on your local system.


Nothing is in the github.com repository, yet


Next step is syncing the code with Github.com


And the files are synced with Github.com



Conclusion

A small blogpost about using Github with Github desktop.

Greetz,
Hennie

zaterdag 11 juni 2016

Installation of Team foundation Server 2015

Introduction

As your projects get bigger and bigger and more people are involved, a normal Visual Studio project is not enough anymore. It is not build for multiple user support. Now in order to maintain the integrity and control in your project, it is a good idea to install Team Foundation Server 2015 and integrate this with your Visual Studio project. Now let's take a look at the installation process of Team Foundation Server. In this blog post I'm showing the installation process with Team Foundation Express 2015.

Installation of Team Foundation Server

First download Team Foundation Express 2015 and execute the installer and it starts with the following window.


The installation continues:


And it reports some warnings at the end of the install process. As it is a warning I decide to neglect this, for now.


When you start Team Foundation you start to configuring SQL Server. Press on Start Wizard.


The configuration begins.


 Again a warning and I decide to neglect this.


Press on next.


This was the installation process of Team Foundation Server 2015 Express.

Conclusion

This is a small blogpost about the installation of Team Foundation Server 2015 Express.


Greetz,

Hennie

dinsdag 7 juni 2016

DAX : Some DAX QTD, YTD and LY calculations with a Period Dimension

Introduction

Sometimes, there are workbooks where you don't have a granularity on a daily basis available but on a higher level. For, instance on a weekly or a monthly level. The problem is that the normal time intelligence function only works on a date dimension on a day granularity) and not a higher level of granularity. In this blog post I'll write down some of the time intelligence based on a monthly basis period dimension. The key of this dimension is based on the format YYYYMM.

Netrevenue

First thing is always create an implicit summary of the measure, in this case the Net revenue. This is a best practice and has many advantages like disconnecting the busnesslogic from the business layer. For more best practices I'll advise you to take a look at this blogpost.

       
SumNR:=SUM(FactSalesPerMonth[NetRevenue])


QuarterToDate (QTD)

One requirement that is often heard is that customers want a QuarterToDate functionality. So in case of month January, February and March the values do add up and it is reset when April starts.

       
SumNetRevenueQTD:=CALCULATE ([SumNR];
                     FILTER(ALL(DimPeriodMonth);
                       DimPeriodMonth[CalendarYear] = VALUES(DimPeriodMonth[CalendarYear]) &&
                       DimPeriodMonth[Quarter] = VALUES(DimPeriodMonth[Quarter]) &&
                       DimPeriodMonth[MonthNumber] <= MAX(DimPeriodMonth[MonthNumber])
                     )
                )
 

YearToDate (YTD)

Yet another one is the YearToDate calculation. This calculation is used to summarize the numbers in a year until a certain point in time.

       
SumNRYTD:=CALCULATE ([SumNR];
                    FILTER(ALL(DimPeriodMonth);
                      DimPeriodMonth[CalendarYear] = VALUES(DimPeriodMonth[CalendarYear]) &&
                      DimPeriodMonth[MonthNumber] <= MAX(DimPeriodMonth[MonthNumber])
                    )
                  )
    

Last Year (LY)

sometimes, customers wants to compare the numbers with last year. This can be done with the following expression:

       
SumNRLY:=CALCULATE([SumNR];
                    FILTER(ALL(DimPeriodMonth);
                      DimPeriodMonth[MonthNumber] = MAX(DimPeriodMonth[MonthNumber]) &&
                      DimPeriodMonth[CalendarYear] = MAX(DimPeriodMonth[CalendarYear]) - 1
                    )
                 )       
 

QuarterToDate LastYear 

The following DAX expression can be used to calculate the Quarter To date, not for this year, but for the year before the this year. And 'this year' depends of the context of the calculation, off course.

       
SumNRQTDLY:=CALCULATE ([SumNR];
               FILTER(ALL(DimPeriodMonth);
                   DimPeriodMonth[CalendarYear] = VALUES(DimPeriodMonth[CalendarYear]) - 1 &&
                   DimPeriodMonth[Quarter] = VALUES(DimPeriodMonth[Quarter]) &&
                   DimPeriodMonth[MonthNumber] <= MAX(DimPeriodMonth[MonthNumber])
               )
            )
       

YearToDate LastYear 

And the last one I would like to mention is the Year To date but for the last year. This DAX expression calculates the sum of last year until a certain point in time (depending on the context of the calculation)

       
SumNRYTDLY:=CALCULATE ([SumNR];
               FILTER(ALL(DimPeriodMonth);
                  DimPeriodMonth[CalendarYear] = VALUES(DimPeriodMonth[CalendarYear])-1 &&
                  DimPeriodMonth[MonthNumber] <= MAX(DimPeriodMonth[MonthNumber])
               )
            )
       


Conclusion

This are some handy DAX expression that you can use in your calculations.

Greetz,
Hennie

maandag 6 juni 2016

Installation of SQL Server Data Tools

Introduction

Now the last part of the installation of SQL Server 2016 and that is SQL Server Data Tools. In the past you had to install SSDT BI and SSDT DB as two separate installations. It was confusing and lead to many misunderstandings. In this installation the two are combined.

Installation process

Start the setup.exe.


Again, a download from a website is started


I choose to install the English version.


And the installation process is executed.


Now check whether we have the DB and BI settings for SSDT and it is..


Conclusion

A blogpost about the installation of SSDT. Both DB and BI are installed in one single installation.

Greetz,

Hennie