Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Dear community,
I'm currently struggling with the following problem. I've got a salestable with amounts and invoicedates. I've also got another table that always contains one date which I transferred into a date table. Now I want to calculate the total amount but only for the period of a year previous to the date in the date table. I tried it as follows:
Solved! Go to Solution.
@Anonymous Maybe:
Measure =
VAR __Date = MAX('Dates'[Date])
VAR __StartDate = DATE(YEAR(__Date)-1,MONTH(__Date),DAY(__Date))
VAR __Table = FILTER('CUSTINVOICETRANS',[InvoiceDate]>=__StartDate && <=__Date)
RETURN
SUMX(__Table,[Total costprice revenue])
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
@Anonymous Maybe:
Measure =
VAR __Date = MAX('Dates'[Date])
VAR __StartDate = DATE(YEAR(__Date)-1,MONTH(__Date),DAY(__Date))
VAR __Table = FILTER('CUSTINVOICETRANS',[InvoiceDate]>=__StartDate && <=__Date)
RETURN
SUMX(__Table,[Total costprice revenue])
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Dear Greg,
Thank you for you response. I had to adjust it a little bit but that was probably due to the fact that by datetable is a little bit strange because it only contains one value, but the output is now correct!
With kind regards,
Diana
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 41 | |
| 22 | |
| 17 |
| User | Count |
|---|---|
| 186 | |
| 116 | |
| 95 | |
| 64 | |
| 45 |