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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
rosiebilton23
Frequent Visitor

Order months in financial year in table

Hi all,

Im sure this is easy to fix but I am at a loss. See screenshot below, my table is is showing January at the front of the table, rather than after Demeber. I have tried a number of ways to creat a month and year column but nothing seems to be working. FYI our financial year is July-June. The transactions on this report have a date against them, in this format 01/01/2024.

 

rosiebilton23_0-1707214183061.png

Any help would be greatly recieved.

Thanks

Rosie 

1 ACCEPTED SOLUTION
CPasten
Frequent Visitor

Have you tried to create an auxiliar calendar table to get Year-Month?

_Calendar =
var _Init = MIN( Table[DateColumn] )
var _Ending = MAX( Table[DateColumn] )
var _Dates = CALENDAR( _Init , _Ending )
RETURN
ADDCOLUMNS( _Dates,
"DayOfMonth", DAY([Date]),
"DayOfYear", DATEDIFF ( DATE ( YEAR ( [Date] ), 1, 1 ), [Date], DAY ) + 1,
"DayOfWeek", FORMAT([Date], "dddd"),
"IDDayOfWeek", WEEKDAY([Date], 2),
"nWeek", WEEKNUM(''[Date] - 1),
"DayOffset" , INT([Date] - TODAY()),
"IDMonth" , MONTH([Date]),
"Month" , FORMAT([Date], "mmm"),
"Quarter", "Qter. " & FORMAT(ROUNDUP( MONTH([Date]) / 3 ,0),"00"),
"Semester", "Smter. " & FORMAT(ROUNDUP( MONTH([Date]) / 6 ,0),"00"),
"FullYear" , YEAR([Date]) ,
"YearMonth", FORMAT([Date], "mmmm - yyyy"),
"IDYearMonth" , FORMAT([Date], "yyyymm"),
"MonthOffset" ,( (12 * YEAR([Date])) + MONTH([Date]) ) - ( (12 * YEAR(TODAY()) + MONTH(TODAY()))),
"YearOffset" , YEAR([Date]) - YEAR(TODAY())
)

 

View solution in original post

1 REPLY 1
CPasten
Frequent Visitor

Have you tried to create an auxiliar calendar table to get Year-Month?

_Calendar =
var _Init = MIN( Table[DateColumn] )
var _Ending = MAX( Table[DateColumn] )
var _Dates = CALENDAR( _Init , _Ending )
RETURN
ADDCOLUMNS( _Dates,
"DayOfMonth", DAY([Date]),
"DayOfYear", DATEDIFF ( DATE ( YEAR ( [Date] ), 1, 1 ), [Date], DAY ) + 1,
"DayOfWeek", FORMAT([Date], "dddd"),
"IDDayOfWeek", WEEKDAY([Date], 2),
"nWeek", WEEKNUM(''[Date] - 1),
"DayOffset" , INT([Date] - TODAY()),
"IDMonth" , MONTH([Date]),
"Month" , FORMAT([Date], "mmm"),
"Quarter", "Qter. " & FORMAT(ROUNDUP( MONTH([Date]) / 3 ,0),"00"),
"Semester", "Smter. " & FORMAT(ROUNDUP( MONTH([Date]) / 6 ,0),"00"),
"FullYear" , YEAR([Date]) ,
"YearMonth", FORMAT([Date], "mmmm - yyyy"),
"IDYearMonth" , FORMAT([Date], "yyyymm"),
"MonthOffset" ,( (12 * YEAR([Date])) + MONTH([Date]) ) - ( (12 * YEAR(TODAY()) + MONTH(TODAY()))),
"YearOffset" , YEAR([Date]) - YEAR(TODAY())
)

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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