Forum Discussion
Conditionally Select A Table give me error message
- 1 year ago
hello jimmyhua
that happens because both FILTER() and TOPN() will give table (multiple value) as return value where your result needs to be a scalar (one value).
i believe FILTER() and TOPN() need another function to return as scalar.
here is a simple examples in form of measure.
Filter =
IF(
ISFILTERED('Table'[Column2]),
CALCULATE(
MAX('Table'[Column1]),
FILTER(
'Table',
'Table'[Index]>=1&&'Table'[Index]<=10
)
),
SELECTEDVALUE('Table'[Column1])
)- unselect (return all value)
- selected (return value with index 1 to 10)
Hope this will help.
Thank you. - 1 year ago
Hello jimmyhua,
Can you please try this approach:
Top10Table = IF( HASONEVALUE(DivisionTable[Division]), FILTER(RankedDivision, [RankByBL] <= 10), // Top 10 for selected division TOPN(10, RankedAll, [Backlog], DESC) // Top 10 for the entire organization )
hello jimmyhua
that happens because both FILTER() and TOPN() will give table (multiple value) as return value where your result needs to be a scalar (one value).
i believe FILTER() and TOPN() need another function to return as scalar.
here is a simple examples in form of measure.
Filter =
IF(
ISFILTERED('Table'[Column2]),
CALCULATE(
MAX('Table'[Column1]),
FILTER(
'Table',
'Table'[Index]>=1&&'Table'[Index]<=10
)
),
SELECTEDVALUE('Table'[Column1])
)
- unselect (return all value)
- selected (return value with index 1 to 10)
Hope this will help.
Thank you.
- jimmyhua1 year agoHelper I
Thank you. This one works.