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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi all
I'm displaying some sales figuers by hour for a given day in a table with both hourly and cumulative numbers, I've been able to get numbers for the day before using
YD rev =
var yesterday = max('Retail Caldender'[Date]) - 1
var amount = CALCULATE(SUM('Actuals TY'[ConvertedRev]),FILTER(ALL('Retail Caldender'),'Retail Caldender'[Date] = yesterday))
return
amount
and a cumualtive number for the sleected day using
Cumulative demand TY hour = if([Demand Local conversion]=0,
"",
CALCULATE('Actuals TY'[Demand Local conversion],
FILTER(ALLSELECTED('Actuals TY'),
'Actuals TY'[hourtime]<= MAX('Actuals TY'[hourtime])
)
)
)
But I can't seem to get a cumulative figute for the previous working, I've tried replacing [Demand Local Conversion] with my [YD rev], buidling it compeltly seperatly and looked online for other ways of calcualting a cumulative totlal but I can't seem to get it to work.
Thanks in advance
Solved! Go to Solution.
@JL_091484 , Try a measure with help from date table like
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) -1 ))
or
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && Date[Date] < today() -1 ))
Hi @amitchandak
Just changed it from
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && Date[Date] < today() -1 ))
to
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && Date[Date] = today() -1 ))
and it works
Thanks for your help
@JL_091484 , Try a measure with help from date table like
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) -1 ))
or
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date]) && Date[Date] < today() -1 ))
Hi @amitchandak
I've tried to adapt it for my tables
Cumulative demand YD hour =
CALCULATE(
SUM('Actuals TY'[ConvertedRev]),
FILTER(ALL('Actuals TY'),'Actuals TY'[hourtime]<=MAX('Actuals TY'[hourtime]) && 'Actuals TY'[dateofpur] <TODAY()-1))
It works for a cumulative sum but appears to be summing across the whole date range rather than one day. I tried ALLSELECTED but then it is blank.