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
Vid
Regular Visitor

How can I get Quarter column values in fiscal year(July to june) format in Power Bi DAX

I have created a Date table with Date column with calenderauto(6) format.

Date table Date column is created from the Data view -> Table tools -> calculations group -> New Table

and

quarter column is a calculated column from the Data view -> Table tools -> calculations group -> New Column

 

 

Date(mm/dd/yyyy)quarter
7/1/2020FY2021 Q1
9/30/2020 FY2021 Q1
10/1/2020 FY2021 Q2
12/31/2020 FY2021 Q2
1/1/2021 FY2021 Q3

3/31/2021

 FY2021 Q3

4/1/2021

 FY2021 Q4

6/30/2021

 FY2021 Q4

 

Quarter('Date'[Date]) formula is calculating the quarters in the fiscal year format Jan to Dec.

But I need to display the quarter values in Fiscal Year format of July2020 to June 2021

July-Sep -- Q1,

Oct -dec -- Q2,

Jan- Mar -- Q3,

Apr-Jun -- Q4

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Hi, @Vid , you may try to add a calculated column this way,

FY Qtr = var __fy_date = EDATE([Date(mm/dd/yyyy)], 6) return "FY" & YEAR(__fy_date) & " Q" & QUARTER(__fy_date)

 Screenshot 2020-09-29 104853.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi @CNENFRNL ,

 

Thanks for the solution. It is working fine.

 

I wrote another formula, Which is also working.

But which one is better for performance for a calculated column?

--------------------------------------------------

Quarter =

"FY" &

YEAR(Date''[Date]) + IF(MONTH('Date'[Date])>6, 1)

& " Q" & 

IF(MONTH('Date'[Date]) <=3, 3,

IF(MONTH('Date'[Date]) <=6, 4,

IF(MONTH('Date'[Date]) <=9, 1, 2)

----------------------------------------

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors