SQL - Study Material
Friday, November 6, 2026
Saturday, October 31, 2026
Running Total/Cumulative Total in DAX
Say we have below data:
Now if we want to calculate the running total, something like below
Cumulative Amt =
CALCULATE
(
SUM(table_orders[Bill_amt]),
FILTER
(all(table_orders),
table_orders[OrderDate] <= MAX(table_orders[OrderDate]
)
)
)
But there is a catch here.
Say we have HotelName as slicer then cumulative total would not be just for that hotel.
We can modify the DAX measure as below:
Ideally if some HotelName filter is applied then we need cumulative total for just the hotel name.
SQL query:
select OrderID , OrderDate, HotelName, FoodItem, Bill_amt, sum(Bill_amt) over (order by OrderDate) from Orders
Friday, October 30, 2026
Thursday, October 29, 2026
Subscribe to:
Posts (Atom)



