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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.