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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
SJHALANI
Helper I
Helper I

Create measure using DAX

Hi Guys!

I have a column in my table which lists "'PO Year". It could have values 2021, 2022 or 2023. I want to create a new column measure called "PO Status" where if the PO year is 2021 or 2022, PO Status should say "Inactive" otherwise "Active".

PO YearPO Status
2021Inactive
2022Inactive
2023Active


What should be the DAX command to help me achieve this? I am new to DAX commands, so any help is appreciated. Thanks!


6 REPLIES 6
devanshi
Helper V
Helper V

IF( OR([PO Year] = 2021 , [PO Year] = 2022 ), "Inactive", "Active")

OR

IF([PO Year] = 2021  ||  [PO Year] = 2022 , "Inactive", "Active")

tamerj1
Super User
Super User

Hi @SJHALANI 

Please try

PO Status =
IF (
    SELECTEDVALUE ( 'Table'[PO Year] ) IN { 2021, 2022 },
    "Inactive",
    "Active"
)

@tamerj1  I am getting the below error. Would you know what this means and how to resolve this?

SJHALANI_0-1687764808742.png

 

@SJHALANI 
Ok, please try

PO Status =
IF (
    SELECTEDVALUE ( 'Table'[PO Year] ) IN { "2021", "2022" },
    "Inactive",
    "Active"
)

@tamerj1  No error now, however PO Status lists Active everywhere.

SJHALANI_0-1687771549477.png

 

@SJHALANI 

Please create it as a measure only not as a calculated column. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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