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
cz1750
Frequent Visitor

Nested IF and OR n DAX

Hi,

 

I have been trying to add calcualted columns in Power BI but I keep getting it wrong. Does anyone know how to create a calcualted colum that is based on IFs and Ors like the following?

 

If (Table[value1] IN ("ABC","DEF,"GHI")  AND Table[value2] = 200 ) THEN
   'Type A'
Else If (

             (Table[value1] = "GGG"  AND Table[value2]  IN (100,300) )

         )

         OR

        (

           (Table[value1] = "III" 

       )

  THEN  
       'Type B'
Else
  'Type C'
End If  

 

 

Thanks

 

John

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@cz1750

 

try

 

Column =
IF (
    'Table'[value1] IN { "ABC", "DEF", "GHI" }
        && 'Table'[value2] = 200,
    "Type A",
    IF (
        'Table'[value1] = "GGG"
            && 'Table'[value2] IN { 100, 300 },
        "Type B",
        "Type C"
    )
)

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@cz1750

 

try

 

Column =
IF (
    'Table'[value1] IN { "ABC", "DEF", "GHI" }
        && 'Table'[value2] = 200,
    "Type A",
    IF (
        'Table'[value1] = "GGG"
            && 'Table'[value2] IN { 100, 300 },
        "Type B",
        "Type C"
    )
)

Hi,

 

Thanks for your reply  - that worked.

 

 

Thanks

 

John

@cz1750,

 

By the way, you may help accept solution. Your contribution is highly appreciated.

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

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors