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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
FR14
Helper I
Helper I

MTD formula with 0 value of orders

Hi Everyone 🙂

 

For MTD i use following formula, but the problem is that when the value of orders are 0 in a month (for example March) it shows values of previous month instead of showing blank or 0. Could anyone help modify this Dax to show 0 or blank when there is no order in a month?

 

Order_Subtotal_CY_MTD = CALCULATE(SUM(OrderLine[Booking USD]),DATESMTD(OrderLine[Open_Date]))
 
 
Thank you so much in advance!
2 ACCEPTED SOLUTIONS
v-jiewu-msft
Community Support
Community Support

Hi @FR14 ,

Based on my testing, please try the following methods:

1.Create the simple table.

vjiewumsft_0-1712193312435.png

2.Create the new measure to calculate.

 

Order_MTD = IF(
    ISBLANK(
        CALCULATE(
            SUM(OrderLine[Booking USD]),
            DATESMTD(OrderLine[Date])
        )
    ), 
    0, 
    CALCULATE(
        SUM(OrderLine[Booking USD]),
        DATESMTD(OrderLine[Date])
    )
)

 

3.Drag the measure into the table visual. The result is shown below.

vjiewumsft_2-1712193382795.png

 

Best Regards,

Wisdom 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

vivek31
Resolver II
Resolver II

hi @FR14 ,

 

try this ,

vivek31_1-1712250848938.png

 

MTD BLANK = CALCULATE(SUM(OrderLine[Booking USD]),DATESMTD(OrderLine[Date])) + 0

 

View solution in original post

2 REPLIES 2
vivek31
Resolver II
Resolver II

hi @FR14 ,

 

try this ,

vivek31_1-1712250848938.png

 

MTD BLANK = CALCULATE(SUM(OrderLine[Booking USD]),DATESMTD(OrderLine[Date])) + 0

 

v-jiewu-msft
Community Support
Community Support

Hi @FR14 ,

Based on my testing, please try the following methods:

1.Create the simple table.

vjiewumsft_0-1712193312435.png

2.Create the new measure to calculate.

 

Order_MTD = IF(
    ISBLANK(
        CALCULATE(
            SUM(OrderLine[Booking USD]),
            DATESMTD(OrderLine[Date])
        )
    ), 
    0, 
    CALCULATE(
        SUM(OrderLine[Booking USD]),
        DATESMTD(OrderLine[Date])
    )
)

 

3.Drag the measure into the table visual. The result is shown below.

vjiewumsft_2-1712193382795.png

 

Best Regards,

Wisdom 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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.