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
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
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.