cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

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.

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
- 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
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]))
2 REPLIES 2
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]))
Helper I

Works like a charm! Thank you so much!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors