Forum Discussion
Anonymous
2 years agoNot applicable
SELECTEDVALUE multiple objects
Hello colleagues! Looks like I have a common issue with = SELECTEDVALUE returning only single value, whereas I need multiple values shown: Are there any ways to simplify the solutins? I met s...
- 2 years ago
correct, you cannot filter if you use CONCATENATEX.
For what you want to achieve you need something close to this
VAR _Selection = VALUES('NEWDataMonth Current'[Month]) VAR CurrentCost = IF( ISBLANK(SELECTEDVALUE('NEWDataMonth Current'[Month])), CALCULATE( [MainSumCost], FILTER( 'DatabaseNEW', 'DatabaseNEW'[Source] = SELECTEDVALUE('NEWDataVersion Current'[Source]) && 'DatabaseNEW'[Date].[Month] IN _Selection ) ), CALCULATE( [MainSumCost], FILTER( 'DatabaseNEW', 'DatabaseNEW'[Source] = SELECTEDVALUE('NEWDataVersion Current'[Source]) && 'DatabaseNEW'[Date].[Month] = SELECTEDVALUE('NEWDataMonth Current'[Month]) ) ) ) RETURN CurrentCost
Alex87
Solution Sage
2 years agocorrect, you cannot filter if you use CONCATENATEX.
For what you want to achieve you need something close to this
VAR _Selection = VALUES('NEWDataMonth Current'[Month])
VAR CurrentCost =
IF(
ISBLANK(SELECTEDVALUE('NEWDataMonth Current'[Month])),
CALCULATE(
[MainSumCost],
FILTER(
'DatabaseNEW',
'DatabaseNEW'[Source] = SELECTEDVALUE('NEWDataVersion Current'[Source])
&& 'DatabaseNEW'[Date].[Month] IN _Selection
)
),
CALCULATE(
[MainSumCost],
FILTER(
'DatabaseNEW',
'DatabaseNEW'[Source] = SELECTEDVALUE('NEWDataVersion Current'[Source])
&& 'DatabaseNEW'[Date].[Month] = SELECTEDVALUE('NEWDataMonth Current'[Month])
)
)
)
RETURN
CurrentCost
- Anonymous2 years agoNot applicable
Thank you! That worked perfectly. Have a nice day!