The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi All,
Need some help with this, please.
So, Every week there is an End calculation, and the End calculation needs to be the base of next week's calculation.
i.e on 1/1/2323 the End = 195, And the End 195 needs to use as the Base of next week 8/1/2323, and so on.
I have tried to find out a solution on the entire web but didn't find anything. I'll really appreciate any input on this, please.
Thanks
Hi,
I am not sure how your end result looks like, but I tried to create a table visualization and a measure like below.
Please check the below picture and the attached pbix file.
Base measure: =
VAR _startdate =
CALCULATE ( MIN ( Data[Date] ), REMOVEFILTERS ( Data ) )
VAR _basestart =
CALCULATE ( SUM ( Data[Base] ), Data[Date] = _startdate )
RETURN
SWITCH (
TRUE (),
MAX ( Data[Date] ) = _startdate, _basestart,
HASONEVALUE ( Data[Date] ),
_basestart
+ CALCULATE (
SUMX ( Data, Data[Increase] + Data[Decrease] ),
WINDOW ( 1, ABS, -1, REL, ALL ( Data[Date] ), ORDERBY ( Data[Date], ASC ) )
)
)
End measure: =
IF (
HASONEVALUE ( Data[Date] )
&& NOT ISBLANK ( SUMX ( Data, Data[Increase] + Data[Decrease] ) ),
[Base measure:]
+ SUMX ( Data, Data[Increase] + Data[Decrease] )
)
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |