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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors
Top Kudoed Authors