# SSAS Tabular Calculation

• ### Question

• Hi,

I am using ssas 2014 tabular in which I have a cost measure based on a location.

Ex

 || Location || Cost || | abc_India | 20 | | final_india | 20 | | bcd_china | 20 | | final_china | 20 |

Basically cost is same for all the location which will be used as a dimension.

Now the requirement is to show final_india+final_china this is 40 by default as measure value but it should split in 4 values if I am dragging location in columns.

EX

COST=40 when i am not using location dimension

but when i am using location attribute in column it should slipt as

 || Location || Cost || | abc_India | 20 | | final_india | 20 | | bcd_china | 20 | | final_china | 20 |

Monday, October 8, 2018 2:15 PM

• Hi Mukul Pratap sengar,

Please have a try following Dax expression:

`Measure = IF(ISBLANK(SELECTEDVALUE(Dim_Location[Location]))=FALSE(),SUMX(Fact_Cost,Fact_Cost[Cost]),CALCULATE(SUM(Fact_Cost[Cost]),(Dim_Location[Location]="final_india")||(Dim_Location[Location]="final_china")))`

Regards,

Pirlo Zhang

MSDN Community Support&lt;br/&gt; Please remember to click &amp;quot;Mark as Answer&amp;quot; the responses that resolved your issue, and to click &amp;quot;Unmark as Answer&amp;quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact &lt;a href=&quot;mailto:MSDNFSF@microsoft.com&quot;&gt;MSDNFSF@microsoft.com&lt;/a&gt;.

Wednesday, October 10, 2018 6:50 AM

### All replies

• Hi Mukul Pratap sengar,

Please have a try following Dax expression:

`Measure = IF(ISBLANK(SELECTEDVALUE(Dim_Location[Location]))=FALSE(),SUMX(Fact_Cost,Fact_Cost[Cost]),CALCULATE(SUM(Fact_Cost[Cost]),(Dim_Location[Location]="final_india")||(Dim_Location[Location]="final_china")))`

Regards,

Pirlo Zhang

MSDN Community Support&lt;br/&gt; Please remember to click &amp;quot;Mark as Answer&amp;quot; the responses that resolved your issue, and to click &amp;quot;Unmark as Answer&amp;quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact &lt;a href=&quot;mailto:MSDNFSF@microsoft.com&quot;&gt;MSDNFSF@microsoft.com&lt;/a&gt;.

Wednesday, October 10, 2018 6:50 AM
• Thanks Pirlo, it worked
Wednesday, October 10, 2018 8:38 AM