Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KW123
Helper V
Helper V

MAX value previous month of the same column

I have one column on an excel sheet that I need to put into my pbi dashboard.  

It's called [Where we actually are YTD] and it is based on a calculation from [YTD funded] which will start at $0 for January 1st, 2022.  To get each value for each day, it is added with a calculated column called WWAA.  

Where I am having a hard time is in February onwards.  To get the first value for February [YTD Funded] for the Where we actually are YTD, I need to take the MAX (or the last value of the previous month) of the Where we actually are YTD. 

So if January 31st is $1000 for example, then Feb 1st will be MAX[where we actually are YTD] +[WWAA] = X

To summarize:
[YTD funded] = MAX/Last date of [Where we actually are YTD] (where January will start at $0)
[Where we actually are YTD] = [YTD funded] + [WWAA] <--- a calculated measure

Is something like this possible? 

4 REPLIES 4
KW123
Helper V
Helper V

February example: 
YTD Funded is the MAX of January (example, $1000) 
WWAA rolling sum 

DayYTD funded Where we actually are YTD 
[YTD funded] + [WWAA]
1$1000$1005
2$1000$1050
3$1000$1500
...28$1000$1800


Then in March, it'll be $1800 + [WWAA] For March 1st. 

Hi, @KW123 

Not fully sure what  the question.

How did you calculate the value of [WWAA]?

If the calculation involves iterative operations, it is recommended to pre-process in Excel before importing into PowerBI.

 

Regards,

Ethan

Hi @Ethan96 
Thanks for the reply. 
The DAX for WWAR is 

WWAR = CALCULATE(SUM('Loan (all)'[Original Balance]),
                                DATESMTD(('Dates'[Date]))) +0

I think where I am struggling is that my previous month doesn't seem to be returning the previous month.  It returns a blank, or the current month. 

Prevmonthc =
CALCULATE([CurrentMonth], ('Dates'[Month] -1 ))

If I try and just get a column of the previous month dates with 
PREVIOUSMONTH('Dates'[Date])
The error message is 'A table of multiple values was supplied where a single value was expected' 


 

To clarify, 
I have a column for Last day of previous month, 

Last day of previous month =
PREVIOUSMONTH('Dates'[Last day of month])

and I have a Dax for MAX value of the column I am trying to calculate
MAXWhatdoesYTDtotalneedtobe =
MAXX(
    KEEPFILTERS(VALUES('Dates'[Date])),
    CALCULATE([What does YTD total need to be])
)
But when create a Dax to show the Max of the PREVIOUS month, it is showing the current month in the report. 

If I use this DAX 
Prevmonthvalue =
CALCULATE([MAXWhatdoesYTDtotalneedtobe],[Last day of previous month])
Then it returns an error saying a Placeholder has been used in a true/false expression..... 




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.