Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a calendar set up.
Where October is my fiscal start:
Solved! Go to Solution.
Step One:
Date =
VAR MinYear = YEAR ( MIN ( Sales[Order Date] ) )
VAR MaxYear = YEAR ( MAX ( Sales[Order Date] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
Step two:
Sales YTD 2 =
CALCULATE (
[Sales Amount],
VAR FirstFiscalMonth = 3 -- Set the first month of the fiscal year
VAR LastDay =
MAX ( 'Date'[Date] )
VAR LastMonth =
MONTH ( LastDay )
VAR LastYear =
YEAR ( LastDay )
- IF ( LastMonth < FirstFiscalMonth, 1 )
VAR FilterYtd =
DATESBETWEEN (
'Date'[Date],
DATE ( LastYear, FirstFiscalMonth, 1 ),
LastDay
)
RETURN
FilterYtd
)
Thank you!!!!
Hi,
There is some problem with the Calendar Table. One will have to work on the file to identify the reason.
Step One:
Date =
VAR MinYear = YEAR ( MIN ( Sales[Order Date] ) )
VAR MaxYear = YEAR ( MAX ( Sales[Order Date] ) )
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", "CY " & YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
Step two:
Sales YTD 2 =
CALCULATE (
[Sales Amount],
VAR FirstFiscalMonth = 3 -- Set the first month of the fiscal year
VAR LastDay =
MAX ( 'Date'[Date] )
VAR LastMonth =
MONTH ( LastDay )
VAR LastYear =
YEAR ( LastDay )
- IF ( LastMonth < FirstFiscalMonth, 1 )
VAR FilterYtd =
DATESBETWEEN (
'Date'[Date],
DATE ( LastYear, FirstFiscalMonth, 1 ),
LastDay
)
RETURN
FilterYtd
)
Thanks! Where steps 2 go? New column? New Measure? and what is [Sales_Amount]?
First is your Calendar table and second is your measure to calculate your values in your date range you need.
But what is [Sales_Amount]?
Any value you have, can be Just sum of your Sale, Count of orders, or Contract, or sum /count of something! Second step depends on what you might need or ignor if you don't. but based on your original question you only need the first step to create your calendar table.
Yeah i dont necessarily need a measure to add anything up , but that calendar does not shift october to my first month of the calendar year?
ADD This column to your calendar!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
95 | |
94 | |
80 | |
71 | |
64 |
User | Count |
---|---|
115 | |
106 | |
96 | |
81 | |
72 |