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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Rolling 5 days back

Hi Guys, 

 

I want to create a line chart with on the axis the date and in the value of the chart the total sum or count of 5 days back from every specific day on the axis. So if in the date axis comes the date 24-10-2019; I want that the linevalue on that date is a sum or count of the days (23-10, 22-10 ,21-10, 20-10, 19-10). 

 

I can't find  or make a measure to fix this, Please help! 

1 ACCEPTED SOLUTION
sanjeev803
Helper I
Helper I

Hi - Try below measure.

 

Rolling 5 Days = CALCULATE(SUM(Data[Value]),DATESINPERIOD(Data[Date],LASTDATE(Data[Date]),-5,DAY))

 

Refer date column in DATESINPERIOD(), and make sure its format is date.

 

I hope this will help.

 

Cheers!
Sanj

 

 

View solution in original post

3 REPLIES 3
sanjeev803
Helper I
Helper I

Hi - Try below measure.

 

Rolling 5 Days = CALCULATE(SUM(Data[Value]),DATESINPERIOD(Data[Date],LASTDATE(Data[Date]),-5,DAY))

 

Refer date column in DATESINPERIOD(), and make sure its format is date.

 

I hope this will help.

 

Cheers!
Sanj

 

 

Anonymous
Not applicable

Nice it kinda works. 

is it possible to set the three different colors(years) over each other.

Now i have a date format on the axis, so the years are after eacht other. 

 

 

Knipsel.PNG

Hi -  I guess this is not possible in power BI till now.

 

Please mark previous reply as solution if that works for you.

 

Kudos are even nice.

 

Cheers!
Sanj

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.