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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
sam95
New Member

How to display a 30 day count of values on a daily basis on a line chart in Power BI.

I've got the folllowing DAX measure, where I am trying to calculate the number of "Completed" treatments for a 30 day period.

 

Test Measure =
CALCULATE (COUNTROWS(FILTER(Treatments,
Treatments [Treatment Status] = "Completed")),
Treatments[Treatment Date] >= Treatments[Treatment Date] - 30)
 
Then I create a line chart, where I select my Test Measure and the date from a calendar table (I want to show this value on a daily basis)
sam95_0-1688034997786.png

 

But what the graph is showing, is the number of Completed treatments on a daily basis, what I want to do is for it to show me on a daily basis the number of "Completed" treatments for 30 days. How can I achieve this?

 
1 REPLY 1
Syk
Super User
Super User

It sounds like you want a running total.. I'd recommend watching this 7 minute video - dax code around 4 minutes in if you want to skip straight to it!

https://www.youtube.com/watch?v=fR0dI5UfZD8

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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