简体   繁体   中英

Slice a measure based on only one attribute in SSAS Tabular

I am trying to create a measure which should slice the value based on only one dimension in SSAS tabular.

eg the cube has a measure Population. and it has dimensions Country and time the data is something like:

Crty_A : 2018 :100
Crty_A : 2017 :200
Crty_B : 2018: 50
Crty_C : 2018: 25

The data in the measure should get aggreted only at country level. like when only country name is selected the data should be like:

Crty_A :300
Crty_B : 50
Crty_B : 25

But if time and the measure is selected the data should be:

2018 :100
2017 :200
2018: 50
2018: 25

is there any way this can be achieved?

You should be able to add simple SUM into your formula that sums the entire column. Save that as your measure and then when you bring the measure into the downstream application (Excel, PowerPivot, PowerBI, ETC) the slicing should already be applied to that measure based on the filters being applied. I'm assuming that you have a star schema and all the tables appropriate relationships.

Measure_Name:=SUM(TableName[Population])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM