cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## Return if one condition OR another is met

I am trying to create a column that returns if a project is "expired" or "not expired."  (My column C)

If the permit start date is less than (before) to the construction start date OR if the construction start date is blank and the permit start date is less than (before/has passed) today it is expired.

 Permit Start Date Construction Start Date New Column (Expired or Not Expired)What I am trying to create 6/24/2023 Expired 1/2/2022 12/30/2021 Not Expired 5/3/2024 5/15/2024 Expired
1 ACCEPTED SOLUTION
Community Support

Hi, @lynnzrae

This DAX only works in Measure creation, if you want to achieve this effect in Calculate column you can use the following DAX.

DAX:

``````Condition column =
IF (
[Permit Start] < [DateConstruction],
"Expired",
IF (
[DateConstruction] = BLANK ()
&& [DateConstruction] < TODAY (),
"Expired",
"Not Expired"
)
)
``````

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

4 REPLIES 4
Helper I

the above didn't return the correct values but I massaged the two formulas together and got what I needed so I am good to go.  Thank you for your help!

Community Support

Hi, @lynnzrae

You can try the following measure to solve the problem.

Measure:

``````Condition =
VAR _permitStart =
SELECTEDVALUE ( 'Table'[Permit Start] )
VAR _dateConstruction =
SELECTEDVALUE ( 'Table'[DateConstruction] )
VAR _today =
TODAY ()
VAR _result =
IF (
HASONEVALUE ( 'Table'[DateConstruction] ),
IF (
( _permitStart < _dateConstruction )
|| (
ISBLANK ( _dateConstruction )
&& _permitStart < _today
),
"Expired",
"Not Expired"
)
)
RETURN
_result
``````

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

Helper I

I copy and pasted and it accepted the formula but it returned empty cells

I have my column with no errors but everything under the column header is blank

Community Support

Hi, @lynnzrae

This DAX only works in Measure creation, if you want to achieve this effect in Calculate column you can use the following DAX.

DAX:

``````Condition column =
IF (
[Permit Start] < [DateConstruction],
"Expired",
IF (
[DateConstruction] = BLANK ()
&& [DateConstruction] < TODAY (),
"Expired",
"Not Expired"
)
)
``````

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors