Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

New calculated member based on existing measure and a dimension value

$
0
0

Hi

I’m trying to create a new calculated member in my cube based on an existing measure and a dimension value.

 

I can do it easily in DSW but I want to do it as a Calculated Member in Calculations tab from my cube.

 

I have a dimension called Product in which one attribute is UOM (unit of measure) and a measure called Quantity. The relationship with the fact table is “Regular”.

 

For each product we have a unit of measure and an associated quantity measure:

 

Product Name   UOM     Quantity

Product 1             Km           50

Product 2             Kg            60

Product 3             Kw           25

Product 4              L               15

Product 5              T              1.5

Total                                     151.5

 

The calculated member I want to create is “Kw” and has to contain the value from Quantity measure when Product.UOM is “kW” and should look like this:

 

Product Name   UOM     Quantity    Kw

Product 1             Km           50           

Product 2             Kg            60

Product 3             Kw           25            25

Product 4              L               15

Product 5              T              1.5

Total                                     151.5        25

 

So far I tried using the MDX with “IIF” or “Case” but with no results.

 

What statement I should use in this case?

 

Thank you.


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>