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
Elu
New Member

DAX calculations new column Quarter

Hi everbody,

 

I am currently learning the DAX calculations for the Power BI certification.

In the exercise a new column ''Quarter'' has to be created with the given snippet code: 

Year =
"FY" & YEAR('Date'[Date]) + IF(MONTH('Date'[Date]) > 6, 1)
 
I have tried to modify the code into:
Quarter =
"FY" & YEAR('Date'[Date]) + IF(MONTH('Date'[Date]) > 6, 1) & "Q1"
 
... but I dont get the same result as in the screenshot attached:

 

Bildschirmfoto 2023-03-29 um 14.25.57.png
Instead, my result is the following:
 
Bildschirmfoto 2023-03-29 um 14.30.08.png

 

How do I need to modify the code to do it correctly?

 

Any help is appreciated!

 

Best, 

Elu

 
2 REPLIES 2
Ameoch
New Member

@Elu  Hey! Could you help me with month formuła in this case? I'm not sure what I'm typing wrong. 
Thanks, Amelia

Uspace87
Resolver III
Resolver III

@Elu 

YEAR_Quarter_ =

VAR Quarter_ = SWITCH(
    TRUE(),
    QUARTER(Date_Table[Date])=1, " Q3",
    QUARTER(Date_Table[Date])=2, " Q4",
    QUARTER(Date_Table[Date])=3, " Q1",
    QUARTER(Date_Table[Date])=4, " Q2"
)

Return "FY " & YEAR(Date_Table[Date]) & Quarter_

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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

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