Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Need help in calculating Running/Cummulative total
I have a given measure that basically counts units grouped by date
Measure1:=CALCULATE(DISTINCTCOUNT(Inv_Fact_Inventory[CURINV_CARGO_ID])
,Inv_Fact_Inventory[Dashboard]="Current Inventory"
,Inv_Fact_Inventory[Inventory Status]="ASSIGNED"
,Inv_Fact_Inventory[Inventory Order Type]="TENDERED NOT SHIPPED")+ [ShippedCount]
Now from this measure i need to calculate running total, so i tried to use the below measure , but its not returning the correct result
Measure2 := SUMX( FILTER ( Inv_Fact_Inventory,
Inv_Fact_Inventory[Dashboard]="Current Inventory" && Inv_Fact_Inventory[Inventory Status]="ASSIGNED" && Inv_Fact_Inventory[Inventory Order Type]="TENDERED NOT SHIPPED"
&& Inv_Fact_Inventory[Received Date] <= MAX(Inv_Fact_Inventory[Received Date])),[Measure1])
When i checked the database Measure2 is not giving the correct value. Please help here
Solved! Go to Solution.
You need the date on the x axis for the running total to be calculated over.
@Anonymous
Try it like this.
Measure 2 :=
VAR _MaxDate =
LASTDATE ( Inv_Fact_Inventory[Received Date] )
RETURN
CALCULATE (
[Measure1],
FILTER (
ALLSELECTED ( Inv_Fact_Inventory[Received Date] ),
Inv_Fact_Inventory[Received Date] <= _MaxDate
)
)
If your model has a calendar table and you are displaying the trending using values from that table you would need to modify the measure to look at the calendar table instead.
Hi,
I'm not seeing any difference between both the measures. Both are returning the same value as seen below.
Here are the measure definition:
Measure5 = CALCULATE(DISTINCTCOUNT(Inv_Fact_Inventory[CURINV_CARGO_ID])
,Inv_Fact_Inventory[Dashboard]="Current Inventory"
,Inv_Fact_Inventory[Inventory Status]="ASSIGNED"
,Inv_Fact_Inventory[Inventory Order Type]="TENDERED NOT SHIPPED")
Measure6 = VAR _MaxDate =
LASTDATE ( Inv_Fact_Inventory[Received Date] )
RETURN
CALCULATE (
[Measure5],
FILTER (
ALLNOBLANKROW( Inv_Fact_Inventory[Received Date] ),
Inv_Fact_Inventory[Received Date] <= _MaxDate
)
)
Am i missing something. Pleas advice
You need the date on the x axis for the running total to be calculated over.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
84 | |
48 | |
48 | |
48 |