Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm looking to create two columns in my table - Fiscal year start and Fiscal year End
Fiscal year start is always the first Monday in April and the end is the Sunday before the Next first monday in April
I create the below based on what I had seen on this post LINK
FiscalEndDate = CEILING(EOMONTH(DATE(year([Date])+1,(04),(01)),-1)-1,7)+1
This works very well apart from JAN FEB and MARCH.
This is what im cuurently getting in my table and you can see from April the new column dax is working but before April it incorrect.
I feel like I need an IF statement potentially to check what date and if its before or after the FiscalEndDate
@Displaced_2000 , Check the last two column of this DAX table
Date = ADDCOLUMNS(CALENDAR(date(2018,01,01), date(2020,10,31))
,"Month Year", FORMAT([Date], "MMM-YYYY")
,"Month Year sort", FORMAT([Date], "YYYYMM")
, "Year", YEAR([Date])
,"Qtr Year" ,FORMAT([Date],"YYYY\QQ"),
"WeekDay", FORMAT([Date], "ddd")
,"Month", FORMAT([Date], "MMM")
,"Month sort", FORMAT([Date], "MM")
,"Week Start Date", [date] - WEEKDAY([Date],2) +1,
"Fy1 Start Date", if(MONTH([date]) <4, date(Year([Date])-1,4,1) ,date(Year([Date]),4,1) ),
"FY Start Date ",
var _date = Date(year([Date]),4,1)
Var _monday = _date -weekday(_date,2) +1
var _final = if(_monday < _date, _monday+7, _monday)
var _date1 = Date(year([Date])-1,4,1)
Var _monday1 = _date1 -weekday(_date1,2) +1
var _final1 = if(_monday1 < _date1, _monday1+7, _monday1)
return
if([Date] < _final, _final1, _final),
"FY End Date ",
var _date = Date(year([Date]),4,1)
Var _monday = _date -weekday(_date,2) +1
var _final = if(_monday < _date, _monday+7, _monday)
var _date1 = Date(year([Date])+1,4,1)
Var _monday1 = _date1 -weekday(_date1,2) +1
var _final1 = if(_monday1 < _date1, _monday1+7, _monday1)
return
if([Date] >= _final, _final1, _final)-1
)
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |