Archivio per la categoria Varie Personali

My Twitter Analysis

Ultimi 3 mesi di twitter, analisi con #PowerBI

Lascia un commento

UseRelationship() and Tabular Row Security

Chris Webb's BI Blog

Quick summary: DAX measures in SSAS Tabular that use the UseRelationship() function return an error when row security is applied to a table. I’m surprised this hasn’t been documented somewhere – I know Marco came across it some time ago, but I ran into it again recently so I thought I’d mention it.

Consider the following simple SSAS Tabular model, based on Adventure Works DW:


There’s an active relationship between DateKey and OrderDateKey, and an inactive relationship between DateKey and ShipDateKey. The following measure returns the sum of Sales Amount and activates the inactive relationship:

Sales Amount by Ship Date:=
CALCULATE(SUM([SalesAmount]), USERELATIONSHIP(FactInternetSales[ShipDateKey], DimDate[DateKey]))


However, when there’s row-level security defined on the DimDate table (though not FactInternetSales) you will see an error for this measure when you browse the model:



ERROR – CALCULATION ABORTED: USERELATIONSHIP function cannot be used while querying table ‘FactInternetSales’ because of the row level security defined on…

View original post 15 altre parole

1 Commento

Aggregating the Result of an MDX Calculation Using Scoped Assignments

Chris Webb's BI Blog

I don’t usually like to blog about topics that I think other people have blogged about already, but despite the fact that Mosha blogged about this several years ago (in fact more than eight years ago, blimey) this particular problem comes up so often with my customers and on the MSDN Forum that I thought I should write something about it myself. So apologies if you know this already…

Here’s the problem description. If you define a calculated measure in MDX, that calculation will take place after the real measure values have all aggregated. For example, consider a super-simple cube with a Year dimension, two real measures called A and B and a calculated measure called [A * B] that returned the value of A multiplied by B. In a PivotTable you’d see the following result:


Note how the Grand Total for the [A * B] calculated measure is 12*16=192…

View original post 653 altre parole

Lascia un commento

New Treemap, Histogram and Streamgraph Apps for Excel 2013

Chris Webb's BI Blog

I blogged about the new app model for Office 2013 and what it means for BI last year, but since then there hasn’t exactly been a massive flood of new data visualisation apps. However… yesterday, I was interested to see that some new apps had been published by the Visualization and Interaction for Business and Entertainment team at Microsoft Research. You can read all the details in this blog post:

The new apps (which are all free) are:

To test the Treemap out, I used Data Explorer to get the overall size on disk of the contents of the folders I use to store my presentation materials; I won’t go into detail about how I did it, but Erik Svenson has a great post on how to do this here. I ended up with a the following treemap:


It’s worth pointing out one…

View original post 29 altre parole

Lascia un commento

Using Scoped Assignments To Show Calendar and Financial Year-To-Date Values In The Same Calculated Measure

Chris Webb's BI Blog

I’ve had a lot of requests for more MDX content on my blog, so here’s something I’ve been meaning to write up for a long time: a worked example of how to use scoped assignments to implement two different types year-to-date calculation on two different hierarchies in the same dimension. Knowledge of how to use scoped assignments is the sign of a true MDX master (you can watch a video of a session I gave on the basics of scoped assignments at SQLBits here if you’re unfamiliar with them) but that’s because they can be very difficult to write and there’s surprisingly little information out there on the internet about them. They are incredibly powerful, though, and often they provide the most elegant and best-performing way to solve a problem.

Let’s start by looking at the Date dimension in the Adventure Works DW sample database, and more specifically the attributes…

View original post 959 altre parole

1 Commento

Reporting Services on Tabular with DAX

Interessante articolo su report parametrizzati in Reporting Services usando DAX per interrogare Analysis Services Tabular.

SQLBI – Marco Russo
Use parameters in your #DAX queries

Kasper de Jonge PowerPivot Blog

Lascia un commento

Creazione di Set personalizzati – Named Set

Nella realizzazione di reportistica capita spesso di dover organizzare i dati in maniera diversa dagli attributi o dalle gerarchie di riferimento nel cubo di Analysis Services.
Per questo motivo il inguaggio MDX mette a disposizione la possibilità di creare dei set personalizzati.

Questi set di dati possono essere realizzati direttamente sul cubo e quindi utilizzati sia nei report di Reporting Services che in Excel 2010 oppure possono essere creati direttamente nel “dataset” del report.

Nell’esempio proposto bisogna realizzare un report come quello in figura:

Le voci presenti in colonna  raggruppano gli attributi della data di produzione secondo le voci presenti in Legenda.

Step 1 – Creazione dei Membri calcolati presenti in colonna.


MEMBER [Periodo Produzione].[Mese].[Oltre M-1] AS
 SUM({[Periodo Produzione].[Mese].&[200001]:STRTOMEMBER(“[Periodo Produzione].[Mese].&[” + CStr(year(Now())) + Right(“000” + Cstr(month(Now())-2),2) + “]”)})

MEMBER [Periodo Produzione].[Mese].[M-1] AS
SUM({STRTOMEMBER(“[Periodo Produzione].[Mese].&[” + CStr(year(Now())) + Right(“000” + Cstr(month(Now())-1),2) + “]”)})

MEMBER [Periodo Produzione].[Mese].[MC] AS
 SUM({STRTOMEMBER(“[Periodo Produzione].[Mese].&[” + CStr(year(Now())) + Right(“000” + Cstr(month(Now())),2) + “]”)})

MEMBER [Periodo Produzione].[Mese].[M+1] AS
SUM({STRTOMEMBER(“[Periodo Produzione].[Mese].&[” + CStr(year(Now())) + Right(“000” + Cstr(month(Now())+1),2) + “]”)})

MEMBER [Periodo Produzione].[Mese].[Oltre M+1] AS
SUM({STRTOMEMBER(“[Periodo Produzione].[Mese].&[” + CStr(year(Now())) + Right(“000” + Cstr(month(Now())+2),2) + “]”):[Periodo Produzione].[Mese].&[201309]})

Step 2 – Creiamo un membro di ordinamento per l’esposizione nel report.

 WHEN [Periodo Produzione].[Mese].currentmember = [Periodo Produzione].[Mese].[Oltre M-1] THEN 1
 WHEN [Periodo Produzione].[Mese].currentmember = [Periodo Produzione].[Mese].[M-1] THEN 2
 WHEN [Periodo Produzione].[Mese].currentmember = [Periodo Produzione].[Mese].[MC] THEN 3
 when [Periodo Produzione].[Mese].currentmember = [Periodo Produzione].[Mese].[M+1] THEN 4
 WHEN [Periodo Produzione].[Mese].currentmember = [Periodo Produzione].[Mese].[Oltre M+1] THEN 5

Step 3 – Creazione del Named Set

SET MeseProduzione as
{[Oltre M-1], [M-1], [MC], [M+1] , [Oltre M+1]}

Step 4 – Query MDX Finale

 NON EMPTY {[Measures].[NomeMisura],OrdinamentoMese} ON COLUMNS,
 NON EMPTY {([DimSocieta].[Societa].[Societa].ALLMEMBERS * MeseProduzione)} ON ROWS
FROM [NomeCubo]

, , ,

Lascia un commento