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
Avishekd1991
New Member

Rolling 30 days for each day for a selected time frame

Hi All...

I am struggling to create an average rolling 30 days Sales KPI for everydate of a selected time frame..

My usecase is:

User will select a date from the date slicer at the top...User will select MTD from the MTD/YTD toggle...and the x-axis on my bar chart will just show the relevant days applicable for that selected date. E.g: if user selects 07/09/2022...my x-axis should have dates from 1st of september to 7th of september.

 

The rolling 30 kpi...should work in the below way:

Bar on 1st Sep should show Avg Sales of 1st Aug till 1st Sept...

Bar on 2nd Sep should show Avg Sales of 2nd Aug till 2nd Sept...

.

.

.

Bar on 7th Sept should show Avg Sales of 7th Aug till 7th Sept...

 

Now when user selects YTD...

my X- axis now shows Months instead of days..

so for the selected day above, it should have Jan - Sept (till 7th)...and the rolling 30 should work in a way 

for Jan - Avg of 1st Jan to 31st jan...feb Avg of 1st to 28th...etc etc...for Sept it should show Avg of 1st sept to 7th Sept...

 

MTD selection is of more priority..

Thanks in advance

1 REPLY 1
lbendlin
Super User
Super User

You can use either EDATE or WINDOW for this.  Note that "Rolling 30" is different from what you describe. For example 7th August to 7th September is 32 days.

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