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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.