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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
zraopingm
Helper III
Helper III

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors