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

If statement not working

Any help appriciated.. getting ERROR message with below condtion
 
P1 = IF(VW_ORT[Partime_Num.?] = 2, DIVIDE (VW_ORT[Annual Salary (Local Currency)], IF(VW_ORT[Partime_Num.?] = 1,(VW_ORT[Annual Salary (Local Currency)]))))
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

@Grande , it looks like you are authoring a measure, aren't you? If so, you might try,

 

P1 =
VAR __pt = MAX ( VW_ORT[Partime_Num.?] )
VAR __as = MAX ( VW_ORT[Annual Salary (Local Currency)] )
RETURN
    IF ( __pt = 2, DIVIDE ( __as, IF ( __pt = 1, __as ) ) )

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
Grande
Frequent Visitor

I would like to creted the below formaula for the which is giving me error Please help me..

 

Annual Salary (USD) - AOP FX Rates + (Annual Salary (USD) - AOP FX Rates * Fringe Rate)

Excel Formula =IFERROR(BR31765+(BR31765*BP31765),"NA")

data Values : 

 Fringe Rate = 15%
AOP FY20 FX Rates = 1
Annual Salary (USD) - AOP FX Rates = 152,360
Annual Salary + Benefits (USD) = 175,774 

 

I created the formula but it does not giving me the correct Results 

I should get the Result = 175774

 

 

Please help me

 

v-lionel-msft
Community Support
Community Support

Hi @Grande ,

 

Has your problem been solved?

 

Best regards,
Lionel Chen

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

v-lionel-msft
Community Support
Community Support

Hi @Grande ,

 

v-lionel-msft_1-1610435180234.png

Even if you want to create a calculated column, this formula has a logic error.

Or Is this what you want?(30/20 =1.5)

v-lionel-msft_2-1610435403110.png

 

Best regards,
Lionel Chen

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

 

 

CNENFRNL
Community Champion
Community Champion

@Grande , it looks like you are authoring a measure, aren't you? If so, you might try,

 

P1 =
VAR __pt = MAX ( VW_ORT[Partime_Num.?] )
VAR __as = MAX ( VW_ORT[Annual Salary (Local Currency)] )
RETURN
    IF ( __pt = 2, DIVIDE ( __as, IF ( __pt = 1, __as ) ) )

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
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!

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.