Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
HI,
I want try and modify the below cumulative measure to ignore dates after a certain point (Today's date). The measure provides a cumulative sum of a value against the report date. I want to try and stop it after a certain point as it is using dates which aren't required.
Solved! Go to Solution.
Try using this :
Cash In Cumulative =
VAR MaxReportDate = MAX('Cash_View'[Report Date])
VAR CutOffDate = TODAY()
RETURN
CALCULATE(
SUM('Cash_View'[Amount]),
FILTER(
ALLSELECTED('Cash_View'[Report Date]),
ISONORAFTER('Cash_View'[Report Date], MaxReportDate, DESC)
&& 'Cash_View'[Report Date] <= CutOffDate
),
'Cash_View'[InOut] = "Cash In"
)
try changing the maxreportdate to today() itself
It has the same effect, it flattens the line and can't correctly plot the week by week cumulative sum
Solved it thanks to your help, I realised i had to apply the filter to the variable to get the Max Report Date relative to that value type. Thanks for your help!
What is date filter used in this case, any date slicer used?
Hi @pankaj_lp ,
No there's no other date filters used, as an update, i tried to change MaxReportDate to
The data table looks like this, its just amounts with "Cash In/Cash Out" for transactions which have taken place, and "Forecast In/Forecast Out" for future amounts. The [Report Date] is a week commencing date
Try using this :
Cash In Cumulative =
VAR MaxReportDate = MAX('Cash_View'[Report Date])
VAR CutOffDate = TODAY()
RETURN
CALCULATE(
SUM('Cash_View'[Amount]),
FILTER(
ALLSELECTED('Cash_View'[Report Date]),
ISONORAFTER('Cash_View'[Report Date], MaxReportDate, DESC)
&& 'Cash_View'[Report Date] <= CutOffDate
),
'Cash_View'[InOut] = "Cash In"
)
Thanks for the reply @pankaj_lp , so i've used the DAX above. It still seems to be using the maximum date from the table (25/09/2023) instead of using "CutOffDate".
For context, this measure is going on a line graph with other similar measures filtered by different [InOut] values, e.g. "Cash In", "Cash Out".etc.
Apply a filter to the datasource as a whole isn't possible in this scenario as some of the measures do need to take into account a date beyond today for "Forecast" values
Neil
what exactly is the certain point, is there a fixed date?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
37 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |