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.
Hello,
My data is at day level and I would like to create a table using DAX measures that retrieve the value (not the sum of the month) at the last day of the previous month and the month before that. So for now the table should look like this:
I would also like to calculate the difference between these two values.
Solved! Go to Solution.
@Anonymous So like this?
Measure =
VAR __LastMonthDate = EOMONTH(TODAY(),-1)
VAR __Last2MonthDate = EOMONTH(TODAY(),-2)
VAR __LastMonth = MAXX(FILTER('Table',[Date]=__LastMonthDate),[Value])
VAR __Last2Month = MAXX(FILTER('Table',[Date]=__Last2MonthDate),[Value])
RETURN
__LastMonth - __Last2Month
Hello,
I have a dataset, linked to a data table. The dataset has values on a daily basis.
We are interested in finding the difference between the value at the end of last month and yesterday's value.
The table will update tomorrow so that the most recent column has values for 3rd September etc but the calculations will remain the same just that 3rd SEPT will then be yesterday's value.
I would like to display these two figures on a card visual.
The values in the table are from a MEASURE:
Hi
Click here to download a solution
How it works
Firstly please do all these free training module to learn abou calendat tables and offsets.
You will then know how to use a Month offset to get the previous month
and the day offset to get the previous day. Then build the rest of the report youself.
Thanks for reaching out for help.
I put in a lot of effort to help you, now please quickly help me by giving kudos.
Remeber we are unpaid volunteers and here to coach you with Power BI and DAX skills and techniques, not do the users job for them. So please click the thumbs up and accept as solution button.
If you give someone a fish then you only give them one meal, but if you teach them how to fish then they can feed themselves and teach others for a lifetime. I prefer to teach members on this forum techniques rather give full solutions and do their job. You can then adapt the technique for your solution, learn some DAX skills for next time and soon become a Power BI Super User like me.
One question per ticket please. If you need to extend your request then please raise a new ticket.
You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !
@Anonymous So like this?
Measure =
VAR __LastMonthDate = EOMONTH(TODAY(),-1)
VAR __Last2MonthDate = EOMONTH(TODAY(),-2)
VAR __LastMonth = MAXX(FILTER('Table',[Date]=__LastMonthDate),[Value])
VAR __Last2Month = MAXX(FILTER('Table',[Date]=__Last2MonthDate),[Value])
RETURN
__LastMonth - __Last2Month
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
7 | |
6 | |
6 |