Hello
I am having trouble writing a measure that works correctly for different slicers. I have 2 tables: Table 1 - store and area; Table 2 - program, store, # events, # calls (see below as could not attach a file).
Company performance = # events (stores in East and West) plus # calls (stores in North)
I need to report this measure in 3 different tables: total performance; performance by area; performance by program. I am trying to write a single measure and re-use it but am not having any luck.
To keep it simple, I am initially trying to write measures for the correct # events only (syntax below is rough only for simplicity):
[Performance] = sum[# events]
[Total performance]=CALCULATE([Performance],stores<>"North")
This works correctly for reporting the total but when I slice by an area, the filter overwrites the slicer. I have tried re-writing this formula different ways eg - using ALLEXCEPT etc but am not having any luck. What is the best way to tackle this?
Thanks
[TABLE="width: 279"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Table 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Store[/TD]
[TD]Area[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]East[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]North[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]East[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]West[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]West[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Table 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Program[/TD]
[TD]Store[/TD]
[TD]# Events[/TD]
[TD]# Calls[/TD]
[/TR]
[TR]
[TD]Dancing[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]Dancing[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]Painting[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]57[/TD]
[/TR]
[TR]
[TD]Fashion[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]Painting[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]61[/TD]
[/TR]
[TR]
[TD]Car maintenance[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
I am having trouble writing a measure that works correctly for different slicers. I have 2 tables: Table 1 - store and area; Table 2 - program, store, # events, # calls (see below as could not attach a file).
Company performance = # events (stores in East and West) plus # calls (stores in North)
I need to report this measure in 3 different tables: total performance; performance by area; performance by program. I am trying to write a single measure and re-use it but am not having any luck.
To keep it simple, I am initially trying to write measures for the correct # events only (syntax below is rough only for simplicity):
[Performance] = sum[# events]
[Total performance]=CALCULATE([Performance],stores<>"North")
This works correctly for reporting the total but when I slice by an area, the filter overwrites the slicer. I have tried re-writing this formula different ways eg - using ALLEXCEPT etc but am not having any luck. What is the best way to tackle this?
Thanks
[TABLE="width: 279"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD]Table 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Store[/TD]
[TD]Area[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]East[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]North[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]East[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]West[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]West[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Table 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Program[/TD]
[TD]Store[/TD]
[TD]# Events[/TD]
[TD]# Calls[/TD]
[/TR]
[TR]
[TD]Dancing[/TD]
[TD]1[/TD]
[TD]3[/TD]
[TD]21[/TD]
[/TR]
[TR]
[TD]Dancing[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]Painting[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]57[/TD]
[/TR]
[TR]
[TD]Fashion[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]Painting[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]61[/TD]
[/TR]
[TR]
[TD]Car maintenance[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]29[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: