Forum Discussion
IF (True/False, TopN1, TopN2) get error message
I need get Top N value from Slicer, but some slicer value is +, some slicer is -, when slicer is +, I will choose TopN, when slicer is -, I will choose bottom N, here is my DAX :
TopN =
var TopProductDesc = TOPN(25, ALLSELECTED('Ultimate'[Credit Ultimate]), [DateSale], DESC)
var TopProductAsc = TOPN(25, ALLSELECTED('Ultimate'[Credit Ultimate]), [DateSale], ASC)
var AscorDesc = SELECTEDVALUE('Measure'[Measure]) IN {"A","B","C","D"}
var TopProduct = IF ( AscorDesc , TopProductDesc, TopProductAsc)
RETURN
TopProduct
error message is :
The True/False expression does not specify a column, Each True/False expression used as a table filter expression must refer to exactly one column.
If I want according measure decide TopN desc or TopN asc, How to modify my DAX, Thank you for help
1 Reply
- AlexisOlson
Super User
It looks like you're trying to create a calculated table. However, calculated tables cannot be responsive to slicers since they are only calculated once per time the data model is loaded, not in response to filtering in the report.