Forum Discussion
Dax date help
7 Replies
- andhiii079845Solution Sage
you can use a the max function. if you have a table with the current data and the new date.
you can say VAR startdate = max(table[datecolumn]) and you can also change your enddate if you want.
VAR enddate = DATEADD(table[datecolumn],-12,MONTH)- amandabus21Helper VI get this error:test =VAR StartDate = MAX(agency_daily_ridership[Merged FC].[Date])VAR EndDate = DATEADD(agency_daily_ridership[Merged FC].[Date], -12, MONTH)RETURN{CALCULATE(CALCULATE( [Sum of KPI],SAMEPERIODLASTYEAR('agency_daily_ridership'[Merged FC].[Date]) ),'agency_daily_ridership'[Merged FC] >= StartDate &&'agency_daily_ridership'[Merged FC] <= EndDate)}
- andhiii079845Solution Sage
My fault, enddate is wrong. The solution:
VAR EndDate = DATE(YEAR(StartDate), MONTH(StartDate)-12, DAY(StartDate)) - amandabus21Helper V
Just getting a blank value.
Is the start date, giving me a start date of the last fiscal year? (July 1st)
- amandabus21Helper V
basically
VarStart Date = Start of last fiscal year
end date = lastest date available in data table
any help is apprecaietd!
- andhiii079845Solution Sage
Can you please post a data example for borh tables: How you define start last fiscal year?
- amandabus21Helper V
We are currently in Fiscal Year 2023. So Calenadr Dates: July 2022 - June 2023.
Last 2022 fiscal year would be: Calendar dates : July 2021 - June 2022
We have data for 2023 fiscal year and want to compare it to how we were doing this time last year.