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
Nagin
Frequent Visitor

Rolling Average with Filtered SUM

Hi All,

I have the following measure which works fine when calculating the rolling average where [hospital_spell_duration_d] is >=1. However I am now trying to create a new measure to identify the rolling average SUM of [hospital_spell_duration_d] and where [hospital_spell_duration_d] is >=1

 

1+ LOS 3 Week Avg Bed Days =
VAR __LAST_DATE =
LASTDATE ( DIM_Date_Table[Date] )
VAR RollingAverage =
AVERAGEX (
DATESBETWEEN (
DIM_Date_Table[Date],
DATEADD ( __LAST_DATE, -20, DAY ),
__LAST_DATE
),
CALCULATE (
COUNT ( 'NEL Admissions'[Admission_Date_Hospital_Provider_Spell] ),
'NEL Admissions'[Hospital_Spell_Duration_D] >= 1
)
)
RETURN
IF ( __LAST_DATE > TODAY (), BLANK (), RollingAverage )

 

Thanks

 

Nagin

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Nagin 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Nagin 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FreemanZ
Super User
Super User

Hi @Nagin  what do you expect to return specifically?

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.

Top Solution Authors