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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.