The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
can someone help me how to create a dynamic sum by Measuere? This should always be the sum of the last 7 days of our sales are drawn? The same for the last 4 weeks and the last half year, starting point should always be the current day.
Regards
Solved! Go to Solution.
@Anonymous
The starting date can be
VAR LastDayWithSales = MAX ( Sales[Order Date] )
then you return the sales amount adjusting the filter context. For example
RETURN
CALCULATE (
SUM ( Sales[Sale Amount] ),
'Date'[Date] >= LastDayWithSales - 49
)
@Anonymous
The starting date can be
VAR LastDayWithSales = MAX ( Sales[Order Date] )
then you return the sales amount adjusting the filter context. For example
RETURN
CALCULATE (
SUM ( Sales[Sale Amount] ),
'Date'[Date] >= LastDayWithSales - 49
)