Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change alternate state with button action

Good day!

Dear colleagues, in my model i have some pivot. it has default alternate state.

Also i have one button. Is there any way to add some action function for this button, which will change alternate state for this pivot, for example, for STATE1?

Thanks.

4 Replies
swuehl
MVP
MVP

I don't think you can directly change the state of chart via a button action, but you can create several charts in different states and use a variable to show / hide these charts. Control this variable in your button action.

jagan
Luminary Alumni
Luminary Alumni

Hi,

It is not possible to change the state of the sheet or objects dynamically, instead you can dynamically use the expression like below

=If(vStateName = 'State1', Sum({[State1]} Sales), Sum(Sales))

Hope this helps you.

Regards,

jagan.

vincent_ardiet
Specialist
Specialist

You can also avoid the IF.

Put in vStateName either $, or [State1]...

Then you expression will be:

=Sum({$(vStateName)} Sales)

Mark_Little
Luminary
Luminary

Hi,

Swuehl's approach is how i always approach this kind of thing

Mark