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.
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)
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
32 | |
30 | |
18 | |
18 |