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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Sum for first or second half of year depending on today's date

Hello,

 

I'm looking for some help trying to calculate the total billed amount for either the first or second half of the year depending on the date. i.e. if today is April 1 then calculate the billed amount for months 1 to 6 (regardless if no data exists for Apr/May/Jun) and if July 1 then calculate amounts for months 7 to 12. I do have a calendar table created however I can't seem to get my head around the syntax to put it together.

Any help would be appreciated!

 

Thank you!

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@Anonymous  - Please try the following:

1. If you don't have a column for semesters (half-years) in your calendar table, add it.

2. Create a measure similar to this:

Your Sum Measure = 
var current_semester = CALCULATE(VALUES('Date'[Semester]), 'Date'[Date] = TODAY())
return CALCULATE(SUM(YourTable[YourColumn]), 'Date'[Semester] = current_semester)

Hope this helps,

Nathan

 

 

View solution in original post

Anonymous
Not applicable

Thanks Natel, it worked perfectly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous  - Please try the following:

1. If you don't have a column for semesters (half-years) in your calendar table, add it.

2. Create a measure similar to this:

Your Sum Measure = 
var current_semester = CALCULATE(VALUES('Date'[Semester]), 'Date'[Date] = TODAY())
return CALCULATE(SUM(YourTable[YourColumn]), 'Date'[Semester] = current_semester)

Hope this helps,

Nathan

 

 

Anonymous
Not applicable

Thanks Natel, it worked perfectly.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors