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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
aishak12
Helper IV
Helper IV

Two Conditions in IF Statement

Hello, 

 

I have three columns 

 

Column A

Column B

Column C

I would like to create a IF Formula with the following statements:

 

IF(Query1[Column B] < 40 = Query1[ColumnA]
IF Query1[Column B] > 40 = 40
IF Column C = "PAN" = 45 

 

How can I create that as a measure? 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @aishak12 

 

For measure:

 

IF (
    SELECTEDVALUE ( 'Table'[Column C] ) = "PAN", 45 ,
    IF ( SUM ( 'Table'[Column B] ) < 40, SUM ( 'Table'[Coulumn A] ), 40 )
)

 

For calcualte colum:

 

IF ( [Column C] = "PAN", 45, IF ( [Column B] < 40, [ColumnA], 40 ) )

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @aishak12 

 

For measure:

 

IF (
    SELECTEDVALUE ( 'Table'[Column C] ) = "PAN", 45 ,
    IF ( SUM ( 'Table'[Column B] ) < 40, SUM ( 'Table'[Coulumn A] ), 40 )
)

 

For calcualte colum:

 

IF ( [Column C] = "PAN", 45, IF ( [Column B] < 40, [ColumnA], 40 ) )

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@aishak12 , Try like

Sumx(Query1,
Switch(True() ,
Query1[Column B] < 40 ,Query1[ColumnA],
Query1[Column B] > 40 , 40,
Query1[Column C] = "PAN" , 45
))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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