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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Maximum Value from the previous calendar month

Hi Guru's,
Am facing a issue in geeting maximum from the previous available values in the the column 

EG: 

In the Column E (Total) where ever the rows are blank, i need to populate maximum value with in the Column E(Total) until that calendar Key , Ex: in Row 18 should be populated with 3436 as this is maximum value for the calendar key 20200201(Feb 2020), in the same way , row 22 , 23 and 24 should be populated by 3524. Can you please help me on this.

 

Dimpu_0-1618140621391.png

 

Kind Regards,

Dimpu

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

You can also create a Calculated column.

 

Fill with Previous Month =

IF (

    ISBLANK ( 'Table'[Total] ),

    CALCULATE (

        MAX ( 'Table'[Total] ),

        FILTER (

            ALL ( 'Table' ),

            NOT ( ISBLANK ( 'Table'[Total] ) )

                && 'Table'[CalendarKey] < EARLIER ( 'Table'[CalendarKey] )

        )

    ),

    'Table'[Total]

)

 

The result looks like this:

v-cazheng-msft_0-1618281444040.png

 

For more details, you can refer the attached pbix file.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

You can also create a Calculated column.

 

Fill with Previous Month =

IF (

    ISBLANK ( 'Table'[Total] ),

    CALCULATE (

        MAX ( 'Table'[Total] ),

        FILTER (

            ALL ( 'Table' ),

            NOT ( ISBLANK ( 'Table'[Total] ) )

                && 'Table'[CalendarKey] < EARLIER ( 'Table'[CalendarKey] )

        )

    ),

    'Table'[Total]

)

 

The result looks like this:

v-cazheng-msft_0-1618281444040.png

 

For more details, you can refer the attached pbix file.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

If months within the year are in ascending order and the figures in the total column are also in ascending order, then the Data > Fill Down option in the Query Editor works ver well.

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
daxer-almighty
Solution Sage
Solution Sage

@Anonymous 

 

I'd suggest doing it in Power Query. This calculation belongs to Power Query, not DAX.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.