Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative Total where zero value are filled with values from previous periode

Hi All,

hope to get help for the following problem.

 

I have a two tables which includes a date, uniqueDevices and activeDevices, there is also a dedicated date table. I want to get a cumulative Total of the activeDevices. The problem I have, for some Countries the activeDevices are the same for couple of weeks and it´s showing Null values in the graph as well as in the table:

Week_Year#Unique DevicesActiveDevices_rollingE
2018-41632
2018-52035
2018-614 
2018-710 
2018-87 
2018-99 
2018-101537
2018-11838
2018-122266
2018-131976
2018-14888

 

 

The formula I´m using is:

ActiveDevices_rollingE = CALCULATE (
SUMX(MeasuresTableAirwatch; MeasuresTableAirwatch[ActiveDevices]);
FILTER(ALL(Period[date]);
Period[Date] <= MAX (Airwatch[AppEnrollmentDate])))

 

I need to have 35 active Devices also in line 2018-6, 2018-7, 2018-8. 

Thanks in advance

Best

Lina

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Yes, try this instead.  (without deleting the relationship)

 

ActiveDevices_rollingE = var endDate = CALCULATE(
	LASTDATE(Airwatch[AppEnrollmentDate]),
	ALL('Airwatch')
)
RETURN
CALCULATE (
	SUM(MeasuresTableAirwatch[ActiveDevices]);	
	ALL(Period[date]);
	Period[Date] <= endDate	
)

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

First off, i've optimised your calculated column:

 

ActiveDevices_rollingE = var endDate = LASTDATE(Airwatch[AppEnrollmentDate])
RETURN
CALCULATE (
	SUM(MeasuresTableAirwatch[ActiveDevices]);	
	ALL(Period[date]);
	Period[Date] <= endDate	
)

Doing this has made me notice that you are getting the last date from the Airwatch table, if you have a table relationship with this you could be fall foul of the context of that join.  I would reconsider that portion next.

Anonymous
Not applicable

Thanks for your answer, the result is the same (missing values for the three weeks). If I delete the relationship between the date table and the AppEnrollmentDate I get the value (88 ActiveDevices) of the last AppEnrollmentDate for all previous weeks. Any other suggestions to solve the problem? Thanks Lina

Anonymous
Not applicable

Yes, try this instead.  (without deleting the relationship)

 

ActiveDevices_rollingE = var endDate = CALCULATE(
	LASTDATE(Airwatch[AppEnrollmentDate]),
	ALL('Airwatch')
)
RETURN
CALCULATE (
	SUM(MeasuresTableAirwatch[ActiveDevices]);	
	ALL(Period[date]);
	Period[Date] <= endDate	
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.