Forum Discussion
al1ceDav1n
3 years agoRegular Visitor
SWITCH STATEMENT NOT WORKING
Hi
Could some one help with the below SWITCH statement? Thanks in advance
Volume = SWITCH( 'RTY_UY'[EFFECT DATE] and 'TYU_JP' [REMAINING_FLAG] = "N", 0 ('RTY_UY'[EFFECT DATE] and 'TYU_JP' [REMAINING_FLAG] = "Y" , COUNT([INT_ID], COUNT([INT_ID]))
Ally
5 Replies
- mlsx4
Memorable Member
Hi al1ceDav1n
It is difficult to know what you're trying to do, but I think you shouldn't include effect date here
Volume = SWITCH( 'TYU_JP' [REMAINING_FLAG], "N", 0, "Y",COUNT([INT_ID], COUNT([INT_ID])) - al1ceDav1nRegular Visitor
Hi Thanks for your reply
The Effective date is needed to work out the COUNT for INT_ID -
I have tried this but still no good
Any other idea's much appreciated
- mlsx4
Memorable Member
But then, include it in the calculate part. Something like this:
Volume = var selectedDate= SELECTEDVALUE('RTY_UY'[EFFECT DATE]) RETURN SWITCH( 'TYU_JP' [REMAINING_FLAG], "N", 0, "Y",CALCULATE(COUNT([INT_ID]),DimDate= selectedDate), CALCULATE(COUNT([INT_ID]),DimDate= selectedDate))- al1ceDav1nRegular Visitor
Hi,
For some reason dislikes the "Y" so close
Thanks