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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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