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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.