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

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

Reply
Anonymous
Not applicable

DAX IF ELSE ERROR

Hi All,

 

i am learning PowerBI and Stucked with below issue.

 

Table Name: Dim1
IDDirection
1Up
2Down
3Up
4Up
5Down

 

Fact_1  
IDCaltegorySalesBudget
1A22
2B31
3C42
4D33
5E54

 

I want to write somthing like this in my measure: Measure=If(Dim1[Direction]="Up"),'Fact_1'[Sales], 'Fact_1'[Budget])

 

Thanks,

KSR

1 REPLY 1
CNENFRNL
Community Champion
Community Champion

Hi, @Anonymous , your formula works in a calculated column; as measure, the syntax is a bit different,

Measure =
IF (
    MAX ( Dim1[Direction] ) = "Up",
    MAX ( 'Fact_1'[Sales] ),
    MAX ( 'Fact_1'[Budget] )
)

 


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
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.