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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
zraopingm
Helper IV
Helper IV

switch with in dax

Hello Community,

can someone please tell me what is wrong with first image below? 

image 2 works fine

thank you

Zoey

zraopingm_0-1713982669939.png

 

zraopingm_1-1713982681665.png

 

 

3 ACCEPTED SOLUTIONS
jgeddes
Super User
Super User

Try 

FYQ = SWITCH(TRUE(), 'Date'[Month No] IN {7,8,9}, "Q4")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Kaviraj11
Super User
Super User

Hi, 

FYQ= SWITCH ( Date[Month No], 1, "Q1", 2, "Q1", 3, "Q1", 4, "Q2", 5, "Q2", 6, "Q2", 7, "Q3", 8, "Q3", 9, "Q3", 10, "Q4", 11, "Q4", 12, "Q4", "Unknown" )

 

OR 

 

FYQ= SWITCH ( TRUE(),

Date[Month No]>=7 && Date[Month No]<=9, "Q3",

Date[Month No]>=1 && Date[Month No]<=3, "Q1",

Date[Month No]>=4 && Date[Month No]<=6, "Q2","Q4" )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Perfect!! thank you

View solution in original post

4 REPLIES 4
Kaviraj11
Super User
Super User

Hi, 

FYQ= SWITCH ( Date[Month No], 1, "Q1", 2, "Q1", 3, "Q1", 4, "Q2", 5, "Q2", 6, "Q2", 7, "Q3", 8, "Q3", 9, "Q3", 10, "Q4", 11, "Q4", 12, "Q4", "Unknown" )

 

OR 

 

FYQ= SWITCH ( TRUE(),

Date[Month No]>=7 && Date[Month No]<=9, "Q3",

Date[Month No]>=1 && Date[Month No]<=3, "Q1",

Date[Month No]>=4 && Date[Month No]<=6, "Q2","Q4" )




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you this is great!

Zoey

jgeddes
Super User
Super User

Try 

FYQ = SWITCH(TRUE(), 'Date'[Month No] IN {7,8,9}, "Q4")





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Perfect!! thank you

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors