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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
slittleson
New Member

Variable date line chart that ALWAYS starts at 0...?

I work in healthcare and need to produce a VLAD chart that looks at outcomes over time.  It is a fairly sime rolling calculation, but Im stuck on the fact it needs a variable  date filter, and the first point always has to be 0 (so whatever the start date, the y axis is zero'd, and  the rolling sum starts).  Just cant get the filtered 0....!!

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

RT with selected time period =
var _sdate = min('Calendar example'[Date])
var _edate = MAX('Calendar example'[Date]) //Mark end and start date based on slicer selection
 
var allRT = CALCULATE(SUM('Quarter calculations'[Value]),
'Calendar example'[Date]<=_edate,ALL('Calendar example')) //calculate running total until the end date
 
var beforeRT = CALCULATE(SUM('Quarter calculations'[Value]),'Calendar example'[Date]<=_sdate,
ALL('Calendar example')) return //calculate RT until start date
allRT-beforeRT //Do substraction to get the RT between slicer dates

End result:

ValtteriN_0-1639864482560.png


I hope this helps to solve your issue and if it does consider accepting this post as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

Here is one way to do this:

RT with selected time period =
var _sdate = min('Calendar example'[Date])
var _edate = MAX('Calendar example'[Date]) //Mark end and start date based on slicer selection
 
var allRT = CALCULATE(SUM('Quarter calculations'[Value]),
'Calendar example'[Date]<=_edate,ALL('Calendar example')) //calculate running total until the end date
 
var beforeRT = CALCULATE(SUM('Quarter calculations'[Value]),'Calendar example'[Date]<=_sdate,
ALL('Calendar example')) return //calculate RT until start date
allRT-beforeRT //Do substraction to get the RT between slicer dates

End result:

ValtteriN_0-1639864482560.png


I hope this helps to solve your issue and if it does consider accepting this post as a solution and giving the post a thumbs up!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors