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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
n5722
Helper I
Helper I

Sum from beginning of quarter to today's date

Hello,

I don't know how to do the following so could someone please give me some advice? I already checked multiple forum posts regarding similar issues but I could not implement it in a way that works.

Screenshot 2021-05-10 at 13.46.10.png

 

In the graph above (which shows the period of Q2) I want to calculate:

- the sum of the dark blue area (named "actual") that should start from the first day of the quarter and end on today's date
and add that to the
- sum of the light blue area (named "forecast") that should start from today's date and end on the last day of the quarter

Both of them are connected to a Date Helper table.

Any advice would be much appreciated!

Thanks!

1 ACCEPTED SOLUTION
Krutigawale33
Responsive Resident
Responsive Resident

Hello @n5722 ,

 

Create below measures,

 

Max Date QTR Start =
DATE ( YEAR(MAX('Date'[Date])), ROUNDUP ( DIVIDE ( MONTH (MAX('Date'[Date])),3 ),0 ) *3 -2, 1)
 
Max Date Qtr End =
EOMONTH ( [Max Date QTR Start],2 )
 
Actual =
CALCULATE(Sum('Table'[Actual]),DATESBETWEEN('Date'[Date],[Max Date QTR Start],TODAY()))
 
Forecast = 
CALCULATE(Sum('Table'[Forcast]),DATESBETWEEN('Date'[Date],TODAY(),[Max Date Qtr End]))

View solution in original post

2 REPLIES 2
Krutigawale33
Responsive Resident
Responsive Resident

Hello @n5722 ,

 

Create below measures,

 

Max Date QTR Start =
DATE ( YEAR(MAX('Date'[Date])), ROUNDUP ( DIVIDE ( MONTH (MAX('Date'[Date])),3 ),0 ) *3 -2, 1)
 
Max Date Qtr End =
EOMONTH ( [Max Date QTR Start],2 )
 
Actual =
CALCULATE(Sum('Table'[Actual]),DATESBETWEEN('Date'[Date],[Max Date QTR Start],TODAY()))
 
Forecast = 
CALCULATE(Sum('Table'[Forcast]),DATESBETWEEN('Date'[Date],TODAY(),[Max Date Qtr End]))

Works like a charm! Thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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