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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
zraopingm
Helper II
Helper II

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
Solution Specialist
Solution Specialist

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

View solution in original post

Perfect!! thank you

View solution in original post

4 REPLIES 4
Kaviraj11
Solution Specialist
Solution Specialist

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

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.