cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Community Support

Hi @FR14 ,

Based on my testing, please try the following methods:

1.Create the simple table.

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.

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.

Frequent Visitor

hi @FR14 ,

try this ,

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

2 REPLIES 2
Frequent Visitor

hi @FR14 ,

try this ,

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

Community Support

Hi @FR14 ,

Based on my testing, please try the following methods:

1.Create the simple table.

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.

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.

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors