cancel
Showing results for
Did you mean:
Member

## Can someone help me to understand the DAX formula ?

Newly Operational in Month = IF(ISBLANK(CALCULATE(SUM(Project[Operating Size]),FILTER(ALLEXCEPT(Project,Countries[Country],'Project Phases'[Phase]),Project[COD Month] = MAX(Dates[Month])))),0,CALCULATE(SUM(Project[Operating Size]),FILTER(ALLEXCEPT(Project,Countries[Country],'Project Phases'[Phase]),Project[COD Month] = MAX(Dates[Month]))))

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft

## Re: Can someone help me to understand the DAX formula ?

Hi @Kolumam,

```Newly Operational in Month =
IF (
ISBLANK (
CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
)
),
0,
CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
)
)```

Based on my assumption, 'Dates' is a calendar table, maybe you added 'Dates'[Month] into a slicer, so, MAX(Dates[Month]) returns a user's selected month in slicer.

```CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
) ```

This CALCULATE expression returns the total value of [Operating Size] grouped by [Country] and [Phase], meanwhile, the COD month should equals the selected month. In other words, it filters the table with the scenario where COD month=selected month, and calculate the total size per country per phase.

```Newly Operational in Month =
IF (
ISBLANK (
<expression>
),
0,
<expression>
)```

This means if <expression> returns blank value, display 0 as result, otherwise, display the result calculated by <expression>.

Reference: IF, ISBLANK, ALLEXCEPT, FILTER

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Microsoft

## Re: Can someone help me to understand the DAX formula ?

Hi @Kolumam,

```Newly Operational in Month =
IF (
ISBLANK (
CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
)
),
0,
CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
)
)```

Based on my assumption, 'Dates' is a calendar table, maybe you added 'Dates'[Month] into a slicer, so, MAX(Dates[Month]) returns a user's selected month in slicer.

```CALCULATE (
SUM ( Project[Operating Size] ),
FILTER (
ALLEXCEPT ( Project, Countries[Country], 'Project Phases'[Phase] ),
Project[COD Month] = MAX ( Dates[Month] )
)
) ```

This CALCULATE expression returns the total value of [Operating Size] grouped by [Country] and [Phase], meanwhile, the COD month should equals the selected month. In other words, it filters the table with the scenario where COD month=selected month, and calculate the total size per country per phase.

```Newly Operational in Month =
IF (
ISBLANK (
<expression>
),
0,
<expression>
)```

This means if <expression> returns blank value, display 0 as result, otherwise, display the result calculated by <expression>.

Reference: IF, ISBLANK, ALLEXCEPT, FILTER

Best regards,

Yuliana Gu

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

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!