Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
al1ceDav1n
Regular 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 5
al1ceDav1n
Regular 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 

 

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))

 

Hi,

For some reason dislikes the "Y" so close 

Thanks 

Hi @al1ceDav1n 

 

I don't understand what's happening. Maybe you need to put a SELECTEDVALUE('TYU_JP' [REMAINING_FLAG]). It is really difficult to figure out the problem without having any information about the structure, the input, the output...

mlsx4
Memorable Member
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]))

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.