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
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
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.