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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jack2of3
Helper II
Helper II

SWITCH not evaluating as expected all the time

Two tables. Days Since is a measure based on a numeric field, FREQUENCY_CODE is a numeric field.

Both Filters work as expected on report with numeric options.

When should be "Yes" - Always evaluates correctly.

When should be "No" - Often evaulates to "Yes"

Training Needed =
SWITCH(TRUE(),
UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE]=1 && TRAINING[Days Since] >= 365, "Yes",
UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE]=2 && TRAINING[Days Since] >= 730, "Yes",
UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE]=3 && TRAINING[Days Since] >= 1095, "Yes",
UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE]=5 && TRAINING[Days Since] >= 1825,"Yes","No")

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Jack2of3 , as days since is measure you have to create a measure like

 


Training Needed =
SWITCH(TRUE(),
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=1 && [Days Since] >= 365, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=2 && [Days Since] >= 730, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=3 && [Days Since] >= 1095, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=5 && [Days Since] >= 1825,"Yes","No")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Jack2of3 , as days since is measure you have to create a measure like

 


Training Needed =
SWITCH(TRUE(),
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=1 && [Days Since] >= 365, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=2 && [Days Since] >= 730, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=3 && [Days Since] >= 1095, "Yes",
max(UTTS_MANDATORY_JOB_CLASS[FREQUENCY_CODE])=5 && [Days Since] >= 1825,"Yes","No")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.