Hi,
We are using the tabular model SSAS to create a scorecard type dashboard in reporting services. In order to this we have several defined measures on various facts in our datawarehouse. In order to produce a scorecard showing the KPI values as rows in a scorecard we have done the following, based on previous ideas seen out there for this kind of thing.
Create a generic kpi measure using a DAX switch statement:
KPI Value:= If(hasonevalue('KPI'[KPIID]), SWITCH(Values('KPI'[KPIID], 1, 'FactClaim'[KPI - Referrals], 2, 'FactHire[KPI - Hires], etc etc)
The 'KPI' dimension is an unrelated dimension (ie it has no relationships to any other object) in the model to allow this to work, with a structure similar to:
Dim KPI (
KPIId int,
KPIName varchar(100))
The intended out put is for us to be able to see something like:
KPI Name Value
KPI 1 10
KPI 12
etc...
This works fine within MDX, but when we try and write a query in DAX we are getting errors saying that the column "KPI Name" cannot be determined in the current context. I'm assuming it's because the 'KPI' dimension is not actually related to anthing, it's just a decode dimenions for the KPIIDs to measures.
The first DAX query below works, the second, with KPI added, fails:
Works:
evaluate
summarize ('FactClaim',
'Date'[Date Year Name],
-- 'KPI'[KPI Name],
"KPI",
calculate('FactClaim'[KPI
- Referrals]))
Fails:
evaluate
summarize ('FactClaim',
'Date'[Date Year Name],
'KPI'[KPI Name],
"KPI",
calculate('FactClaim'[KPI
- Referrals]))
With the error below:
Query (2, 7) The column 'KPI Name' specified in the 'SUMMARIZE' function was not found in the input table.
Has anyone got any ideas as to what we need to do? Using MDX and the cube browser works fine, it's just DAX isn't liking it. I'm assuming there's a way to do this in Dax though...
Thanks
Mike
Mike Dobing