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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I want to create a DAX or a column in order to get the sum between the date and minus 365 days.
I have created three tables:
1) Data Table
2) Sales Table
3) Order in hand Table
I want to get the sum from the sales table for each row in the order in hand table. Therefore I have provided the start date (date Minus 365) and the end date (Date)
I have tried serveral options like datesinperiod/datesbetween.
Any suggestions?
Kind Regards!
Solved! Go to Solution.
Hi @Sunshine123 ,
I created some data:
Order in hand Table:
Here are the steps you can follow:
1. Create measure.
Measure =
var _mindate=
MINX(FILTER(ALL('Sales Table'),'Sales Table'[Date Minus 365]>=MAX('Order in hand Table'[Date])),[Date Minus 365])
return
CALCULATE(
SUM('Sales Table'[Sales]),FILTER(ALL('Sales Table'),'Sales Table'[Date Minus 365]=_mindate))
2. Result:
If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information, or Order in hand Table data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Sunshine123 ,
I created some data:
Order in hand Table:
Here are the steps you can follow:
1. Create measure.
Measure =
var _mindate=
MINX(FILTER(ALL('Sales Table'),'Sales Table'[Date Minus 365]>=MAX('Order in hand Table'[Date])),[Date Minus 365])
return
CALCULATE(
SUM('Sales Table'[Sales]),FILTER(ALL('Sales Table'),'Sales Table'[Date Minus 365]=_mindate))
2. Result:
If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information, or Order in hand Table data.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly