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

Don'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.

Reply
Invesco
Helper V
Helper V

Previous month make all month date that start with "01/01" zero

Hi Experts

 

How would you amend the following messure to make all those month that are 01/01 irrespective of year return zero value as opposed to the previous month value.

 

Meaure =

PREVIOUSMonth =

IF(CALCULATE(SUM(Orders[Sales]),

 

        PREVIOUSMONTH(Orders[DDate]))=01/01,0,CALCULATE(SUM(Orders[Sales]),

 

        PREVIOUSMONTH(Orders[DDate])))

Not working

1 ACCEPTED SOLUTION

Hi, @Invesco ;

If it is measure,

PREVIOUSMonth =
IF (
    MONTH (max( Orders[DDate]) ) = 1
        && DAY ( max( Orders[DDate]) ) = 1,
    0,
    CALCULATE ( SUM ( Orders[Sales] ), PREVIOUSMONTH ( Orders[DDate] ) )
)


Best Regards,
Community Support Team _ Yalan Wu
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-yalanwu-msft
Community Support
Community Support

Hi, @Invesco ;

Try it.

PREVIOUSMonth =
IF (
    MONTH ( Orders[DDate] ) = 1
        && DAY ( Orders[DDate] ) = 1,
    0,
    CALCULATE ( SUM ( Orders[Sales] ), PREVIOUSMONTH ( Orders[DDate] ) )
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Hi Team Yalan is the above a messure or calculated column measure

Hi, @Invesco ;

If it is measure,

PREVIOUSMonth =
IF (
    MONTH (max( Orders[DDate]) ) = 1
        && DAY ( max( Orders[DDate]) ) = 1,
    0,
    CALCULATE ( SUM ( Orders[Sales] ), PREVIOUSMONTH ( Orders[DDate] ) )
)


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.