Forum Discussion
User entered date with comparison column for previous year
I am trying to have a custom date range that the user can enter dates and I want a column that shows the values for that current date range and a second column that shows the values for that month/day but for the previous year. So for example I have a sold date set to 6/1/2023- 6/15/2023 that the user entered and a column showing this year sold amount of 1000. I want the second column to show the sold amount of last year 6/1/2022-6/15/2022 lets say 800. I am trying to use a matrix visual to do this and have slicers for users to choose their start and end date. I have experience with tableau so there I could enter a date parameter and set calculations to compare to the start and end date parameters and subtract a year from those parameters that the users were entering themselves. Looking for something similar in power bi.
How do you prevent the user from selecting a range that reaches across years? What should happen if they select 2022-10-01 to 2023-02-28 ?
See attached for a standard approach using SAMEPERIODLASTYEAR
9 Replies
- lbendlin
Super User
a custom date range that the user can enter datesI am trying to use a matrix visual to do this and have slicers for users to choose their start and end date.These statements are ambiguous. Are you planning to allow your users to manually enter a date, or are you restricting them to have to select an existing date?
- wilberkFrequent Visitor
I want the user to manually enter the date they desire for this year and get the comparison between this year and last years data in the matrix
- lbendlin
Super User
There is no good visual for manually entering data in Power BI. Will you be using the filter pane with advanced mode filters?