Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Use DAX to create measures in Tabular Model that will apply different logic at each level of heirarchy. Can it be done?

$
0
0
How to say it?I have a fact table and within it a hierarchy, which I created. Now I need to write a DAX calculation that will SUM(facts) differently at one level of the hierarchy than another.Example:Heirarchy:1. Engagement2. Project type3. Delivery type4. Project Name5. Cost Type6. ResourceI need to create a single measure called Planned Rev, but the logic needed for its' value is going to be different depending on the level of the hierarchy at which it is being calculated. Need to explicitly reference the different levels of the hierarchy when writing a DAX expression so that a unique set of instructions are used at each level of hierarchy.Once surfaced in a pivot table , the appropriate section of the DAX calculation needs to be used at the intersection of each level of hierarchy and the measure. eg. Measure is called 'Planned Rev'. Psuedocode for 'Planned Rev' measure:At Delivery type level, if Cost Type = A then SUM(TotalSubconPlannedRevenue) if Cost Type = B then (SUM(TotalFTEPlannedRevenue) else 0, at Project Name level, SUM(TotalFixedFeePlannedRevenue). At Cost Type level, set to 'NA'.Goal being that Delivery type, Cost Type, and Project Name will be rows, and the measure column will render the appropriate calculations at the respective level of hierarchy.Is this possible? Is this called Scoping? Can someone provide links? Can someone provide guidance of any kind?

Viewing all articles
Browse latest Browse all 1341

Trending Articles