"running total"
4 TopicsResetting my cumulative total when it dips below zero
Hi I have a cumulative sum that has a starting total which then needs to be adding a Loadingtotal. this loading total could be positive or negative. if the cumulitive sum goes below zero it should reset and start adding the loading total as if it was starting again but at zero. I have the following as an example Any help would be appreciatedSolved1.3KViews1like12CommentsCumulative measure & filters
Hello everyone, I created a graph, like you can see on the picture. I created the 2 curve by using the command "New visual calculation - Running sum" Everything is working well until I Try to apply filters on my graph ( The blue bars are adapting correctly) . I can Imagine that it is because the running sum is calculated before the the filters and it does not update the values. I also added the tab version of my graph. Does someone have an idea how to resolve this ? Thank you.546Views0likes3CommentsCalculating weekly running sum
Hello, my semantic model has the following structure: In the fact table FACT_REVENUE, for each snapshot_date/departure_date combination there is a revenue value. It has full revenue value only for Sunday snapshot dates (sunday_delta = 'sunday'). Snapshot dates for the rest of the week (sunday_delta = 'delta') are deltas to the previous day. E.g., the revenue for Wednesday, is a sum of revenue for all snapshot_dates since last Sunday to Wednesday (including Wednesday) for a certain departure_date. Dimension tables DIM_SNAPSHOT_CALENDAR and DIM_DEPARTURE_CALENDAR contain all snapshot_dates and all departure_dates, accordingly. I am using the following formula to calculate the weekly running sum of revenue: revenue_running_sum = VAR maximus = MAX ( dim_snapshot_calendar[snapshot_date] ) VAR totalSplit = CALCULATE ( SUM ( fact_revenue[revenue] ), dim_snapshot_calendar[snapshot_date] <= maximus, dim_snapshot_calendar[snapshot_date] >= maximus + 1 - WEEKDAY ( maximus - 7 ) ) RETURN SUMX ( ADDCOLUMNS ( VALUES ( dim_snapshot_calendar[snapshot_date] ), "@Value", 0 ), totalSplit ) First maximum selected snapsh-date is obtained (maximums). The sum is calculated for snapshot_dates <= maximus and snapshot_dates >= last Sunday. When filters on DIM_SNAPSHOT_CALENDAR[snapshot_date] and DIM_DEPARTURE_CALENDAR[departure_date] are applied, the results are correct: However, if I split the result by FACT_REVENUE[days_before_departure] (it is a difference between departure_date and snapshot_date), the results are split into each day since last Sunday: It seems to happen, because when calculating the running sum these snapshot_date/departure_date combinations are selected and when a filter from FACT_REVENUE table is in scope, then it is dispayed as split into those snapshot_date/departure_date combinations. The expected result is: Thus, the sum should be displayed for days_before_departure = 1/31/2024 - 2/7/2024 = -7. Would appreciate any help or suggestions. Thank you1.4KViews0likes4CommentsDisplay Two Different Dates from the same point on the X axis.
Hi, me again. I want to plot two lines that start from different dates in POWER BI. I have products that have a differents date of creation and i have to display the product since it launch on a line chart as X=0, so that my users get an understanding of how the respective product have fallen in delincuency product launch. This is what i currently have: This just a running total of the percentage of clients that fell into delincuency, but notice that both of these linnes start at different dates, they should star at point 0, measured by the numbers of weeks since the product launched. Sometihng like: Imagine that in the X axis we have numbers from 0 to whatever and that both start from 0, i just picked the two closest that i had. I'll leave a mockup file attached, product of previous help: https://drive.google.com/file/d/1uems6jCzxqkJHNdtcnXxxHxBo222XPB1/view?usp=drive_linkSolved998Views0likes3Comments