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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
shakir99
Frequent Visitor

Converting Date and Time to Financial Year and Quarter/Month (Australian Date)

Hi All,

I currently have a column (StartDate) that has values in the following format:

DD/MM/YYYY HH:MM:SS AM/PM
E.g. 14/08/2022 2:00:00 PM

I was hoping to accomplish conversions through DAX commands but wasn't really sure how to approach it, 

 

New Column 1 (Month & Financial Year) 

14/08/2022 2:00:00 PM --> Aug FY22

 

New Column 2 (Quarter and Financial Year)
14/08/2022 2:00:00 PM --> Q1 FY22

 

Any help or guidance would be appreciated!

5 REPLIES 5
Arul
Super User
Super User

@shakir99 ,

For new column 1 you can use below to queries and create calculated column,

 

FY = IF(MONTH('Time'[Date])>=7,YEAR('Time'[Date]),YEAR('Time'[Date])-1)
Month FY = FORMAT('Time'[Date],"MMM") &" "&"FY"& RIGHT('Time'[FY],2)

 

for new column 2 you can refer the below thread,

https://community.powerbi.com/t5/Desktop/Convert-UTC-to-client-time-zones/m-p/56337 

Thanks,

Arul 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


shakir99
Frequent Visitor

Hi @Arul 
Thanks for your answer. 

This solution, "FY = IF(MONTH('Time....."

Works fine however shows blank values in 'Time'[Date] as 1899. Is there a way to instead have that value as "Blank"

 

Regarding the next solution, "Month FY = FORMAT...."

This is working fine as well but is showing that FY99 value because of the 1899 value in the FY column.

 

Again thank you for the solutions however how'd I replace the 1899 with blank instead, and also have that be the case for the second column 

Hi @shakir99,

In fact, 12/31/1899 should be the default value of date fields, they will be displayed if the value does not include the date part or stored the blank values.

You can add an if statement condition to check if the current date field value is blank or less than particular values to prevent the calculation of wrong date ranges.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thanks @v-shex-msft , would it be possible to show some example code? I'm under the understanding that you'd use if (<condition>, [table]FY,(I'd normally put Blank() here however that would result in 'blank' appearing on output visualisation/table))

So still a little confused on how to not show blanks or the 1899's in the output value. 

Hi @shakir99,

Can you please share some dummy data that keep the raw data structure? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.