Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have a measure that calculates the amount of change in total sales for each sales person between the first date and the most recent date, and I would like to create a slicer to filter this. My measure is calculated like this:
Amount of Change =
VAR _end = LASTDATE('Sales'[Date])
VAR _start = FIRSTDATE('Sales'[Date])
VAR _startnum = CALCULATE(SUM('Sales'[Total Sales]), FILTER('Sales', [Date] = _start))
VAR _endnum = CALCULATE(SUM('Sales'[Total Sales]), FILTER('Sales', [Date] = _end))
RETURN
_endnum - _startnum
I also have a date slicer so that the end user can filter to specific dates as needed and see the amount of change.
Thank you in advance!
You will probably need 2 separate date tables to use in the slicer, one for the _Enddate another for the _Startdate
the 2 tables shouldn't have any relationship with your sales table
your Variables should look something like this
Amount of Change =
VAR _end = SELECTEDVALUE('Yourdatecolumn in the end date table')
VAR _start = SELECTEDVALUE('Yourdatecolumn in the start date table')
VAR _startnum = CALCULATE(SUM('Sales'[Total Sales]), FILTER('Sales', [Date] = _start))
VAR _endnum = CALCULATE(SUM('Sales'[Total Sales]), FILTER('Sales', [Date] = _end))
RETURN
_endnum - _startnum
If I answered your question please accept this reply as the solution 🙂
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
39 |