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.
Hi there,
I am calculating the cumulative sum by the end of last month. I only consider those months that are gone (not the current month). I have developed the measure which looks like as follow:
Hi @Dunner2020 ,
It may be because your EOMONTH function is wrong. Try
Var last_month_date = EOMONTH(EOMONTH(TODAY(),0),0)
Reference: EOMONTH DAX
If I fail to answer the question, please provide some sample data, which will be very useful for me to help you.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-stephen-msft , your modified statement produces the end date of current month not the last month.
@Dunner2020 , Try like
Var last_month_date = EOMONTH(TODAY(),-1)
var CurrentDate = MAX('Table'[Actual Incident Start Time ])
Return
sumx(
filter(ALL('Outages and Interruptions'),'Outages and Interruptions'[Actual Interruption Start Time (NZST)]<=CurrentDate && 'Outages and Interruptions'[Actual Interruption Start Time (NZST)<=last_month_date ), [sum_measure])
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
@amitchandak , my measure is as follow :
As you can see that it still showing value of September and October.
a) var last_month_date = EOMONTH(TODAY(), -1)
-- gives last month date. (9/30/2020)
-- Minor, FYI, nothing is wrong in your code ... more of FYI
b) Cumulative Sum calc - Try this
Cumulative sum =
var last_month_date = EOMONTH(TODAY(),-1)
Return Calculate (
SUM( [sum_measure])
, filter(
ALL('Outages and Interruptions'[Actual Interruption Start Time (NZST)])
,'Outages and Interruptions'[Actual Interruption Start Time (NZST)]
<= last_month_date ))
My reason for changing the formula: suspecting ALL('Outages and Interruptions') is wrong
and also, A <= B and B <= C is equal to A <= C
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |