Hello All, I am trying to migrate one of our cubes from SSAS 2008 to 2012 Tabular and am struggling to figure out how to port over a specific calculated column from MDX to DAX. I am attempting to use two different measures from two different measure groups( Install_001 from FactUsers and Cost from FactSpending) and basing a calculation off of that. I have two measure groups FactUsers and FactSpending --The logical primary key of this table is a combination of (CampaignCode, CampaignDateId) CREATE TABLE #FactSpending( CampaignCode varchar(255), CampaignCodePK INT, CampaignDateId INT, Views INT, Clicks INT, Cost INT, Engagement INT) --The logical primary key of this table is UserId. CREATE TABLE #FactUsers( UserId INT, AllocatedCost INT, Views INT, Clicks INT, AllocatedHouseholdCount INT, Install_001 INT, DScore INT, CampaignCodePK INT)This is the calculated column in MDX which works fine in SSAS 2008 :IIF([Measures].[User Install_001]=0, NULL, [Measures].[TotalCost] / [Measures].[User Install_001])And this is what I am attempting to write in 2012 Tabular in DAX :Campaign CPI_001:=IF([FactUsers[Install_001]]=0,BLANK(), FactSpending[Cost]/Users[Install_001])I get a "Semantic error: The value for column 'Install_001' in table 'Users' cannot be determined in the current context. Check that all the columns referenced in the calculation expression exist, and that there are not circular dependencies ... The column does not have a single value; it has many values, one for each row of the tables, and no row has been specified"I read up on some blogs and tried to write something like this -CPI_001 := CALCULATE ( SUM ( FactSpending[Cost] ), USERELATIONSHIP ( FactSpending[CampaignCodePK], FactUsers[CampaignCodePK] ))I end up getting this - Measure 'FactSpending'[CPI_001] : USERELATIONSHIP function can only use the two columns references participating in relationship.
↧