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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.