Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SUM last business month
10-30-2019
06:46 AM
Hello everybody!
I would like to sum all the values for the last business month.
The business months have individual start and end dates.
That means I can't use previousmonth function.
How can I transfer that code for business months?
=var currentMonth = Month(today())-1
Return
CALCULATE(sum('DB'[Values]);'Calendar'[Business Month Number] = currentMonth)
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2019
04:15 PM
Hello @joshua1990
Is Business Month Number a sequential value increments by one for each month across multiple years (for example Year*12 + Month)?
If it's not, I suggest you create such a column in 'Calendar' first.
Once you do you have such a Business Month Number column, you could write something like this:
=
VAR currentMonth =
CALCULATE (
MAX ( 'Calendar'[Business Month Number] );
'Calendar'[Date] = TODAY ();
ALL ( 'Calendar' ) // Not required if 'Calendar' is marked as a date table
) - 1
RETURN
CALCULATE (
SUM ( 'DB'[Values] );
'Calendar'[Business Month Number] = currentMonth;
ALL ( 'Calendar' )
)
Regards,
Owen

Helpful resources
Announcements
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Recommendations
Subject | Author | Posted | |
---|---|---|---|
08-15-2024 08:50 PM | |||
05-02-2024 07:55 AM | |||
11-01-2024 02:44 AM | |||
Anonymous
| 07-19-2024 11:07 PM | ||
09-23-2024 07:09 PM |
Top Solution Authors (Last Month)
User | Count |
---|---|
24 | |
13 | |
11 | |
10 | |
9 |
Top Kudoed Authors (Last Month)
User | Count |
---|---|
18 | |
14 | |
14 | |
12 | |
11 |