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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to apply most recent data from the current month and to apply in to the future months

Dear Everyone,

I am trying to apply the values from the most recent month from Sales Table by products and to apply the same values for the future months.

I have Sales table with Sales [Dates] and connected with Dates [Dates] for applying current and future periods.

As Sales table is updated with new month values the measures should again update the figures for future months.

Any help is highly appreciated!

 

 

3 ACCEPTED SOLUTIONS

Hi  @Anonymous ,

 

If so,you have to delete the relationship between the two tables;

Then create a measure as below:

Measure =
VAR _maxdate =
    MAXX ( ALL ( 'Sales Table' ), 'Sales Table'[Sales Date] )
RETURN
    IF (
        MONTH ( MAX ( 'Dates'[Period] ) ) > MONTH ( _maxdate ),
        CALCULATE (
            SUM ( 'Sales Table'[Sales Amount] ),
            FILTER (
                'Sales Table',
                MONTH ( 'Sales Table'[Sales Date] ) = MONTH ( _maxdate )
                    && YEAR ( 'Sales Table'[Sales Date] ) = YEAR ( _maxdate )
            )
        ),
        CALCULATE (
            SUM ( 'Sales Table'[Sales Amount] ),
            FILTER (
                'Sales Table',
                YEAR ( 'Sales Table'[Sales Date] ) = YEAR ( MAX ( 'Dates'[Period] ) )
                    && MONTH ( 'Sales Table'[Sales Date] ) = MONTH ( MAX ( 'Dates'[Period] ) )
            )
        )
    )

And you will see:

vkellymsft_0-1627955952260.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

Anonymous
Not applicable

Hello Kelly,

 

Yes it works ! Thank you very much !

View solution in original post

Hi  @Anonymous ,

 

Glad to help.

Would you pls check my signature?🙂

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous ,

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

 

MTD Max=

var _today = maxx(allselected('Sales'), 'Sales'[sales date])
var _min = eomonth(_today ,-1)+1
var _max = _today
return
CALCULATE(sum('Sales'[Sales Amounr]), FILTER(ALL('order'),'order'[Date] >= _min && 'order'[Date] <=_max ) )

 

Try measures like

 

final measure =

var _today = maxx(allselected('Sales'), 'Sales'[sales date])

return 

if(isblank([MTD Sales]) && Max(Date[Date]) =_today , [MTD Max],[MTD Sales])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Dear @amitchandak ,

 

Thank you for quick reply ! Just to clarify 'Order' table and Order[Date]. Where these should come from ?

I have Sales and Dates table with columns [Date]. I am not sure about Order. Did you mean Dates table and [Date] column? I have applied this but I still get the table with only the last month figures. It does not show future months even though the time slicer is set with future months included....

Hi  @Anonymous,

 

Could you pls provide some dummy data with expected output for test?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hello Kelly,

 

Here is the link below with the sample file.  I have the most recent data of sales ending with July 2021. I would like to replicate the same values from the month of July to the future months connected with the Dates table. Print Screen.png

 

https://drive.google.com/file/d/1TJtor3ppAPirpTbbIX7Hh0dQrxtzRmmG/view?usp=sharing 

 

Hi  @Anonymous ,

 

If so,you have to delete the relationship between the two tables;

Then create a measure as below:

Measure =
VAR _maxdate =
    MAXX ( ALL ( 'Sales Table' ), 'Sales Table'[Sales Date] )
RETURN
    IF (
        MONTH ( MAX ( 'Dates'[Period] ) ) > MONTH ( _maxdate ),
        CALCULATE (
            SUM ( 'Sales Table'[Sales Amount] ),
            FILTER (
                'Sales Table',
                MONTH ( 'Sales Table'[Sales Date] ) = MONTH ( _maxdate )
                    && YEAR ( 'Sales Table'[Sales Date] ) = YEAR ( _maxdate )
            )
        ),
        CALCULATE (
            SUM ( 'Sales Table'[Sales Amount] ),
            FILTER (
                'Sales Table',
                YEAR ( 'Sales Table'[Sales Date] ) = YEAR ( MAX ( 'Dates'[Period] ) )
                    && MONTH ( 'Sales Table'[Sales Date] ) = MONTH ( MAX ( 'Dates'[Period] ) )
            )
        )
    )

And you will see:

vkellymsft_0-1627955952260.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Hello Kelly,

 

Yes it works ! Thank you very much !

Hi  @Anonymous ,

 

Glad to help.

Would you pls check my signature?🙂

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors