Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I make a measure conditioned to a selected option in a filter pane?
For instance, my filter option under Department (this is the name of the field) is "CORP", I want the measure to adjust to this filter wheter CORP is selected or not.
It could be something like: if(Department = 'CORP', SUM(Amount1), SUM(Amount2))
I would appreciate your help.
for this type of solution I use an extension to set a variable and apply to the measure, dimension etc.. See this link for a example of how I've don'te it in the past.
What if you used the concat() function to establish the possible values. It's a stretch but doesn't require building an extension object.
=if(concat(DISTINCT [Department Type], ', ') like '*CORP*', SUM(Amount1), SUM(Amount2))
Try this expression
If(SubStringCount('|' & GetFieldSelections(Department , '|', 10000) & '|', '|CORP|'), SUM(Amount1), SUM(Amount2))
OR
If you select only one department always then use below expression
if(Only(Department) = 'CORP', SUM(Amount1), SUM(Amount2))
Hope this helps you.
Regards,
Jagan.
HI,
Try this Expression
Sum(if(Department='CORP',Amount1,Amount2))
Hi Cesar,
Your expression will just work fine "if(Department = 'CORP', SUM(Amount1), SUM(Amount2))" if you have a second dimmension added to your visual. This will even work when you have a filter set. So adding a second dimension which has the value CORP will do.