The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
@DLU 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-TIT...
@DLU 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-TIT...
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
264 | |
120 | |
115 | |
83 | |
70 |