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
Anonymous
Not applicable

Need help - if statement in Dax is not giving desired result

Hello All,

I have sales rep column, and their total sales. i am showing the results in the below matrix

 

unnipbi123_0-1643781291488.png

so the actual value that i am trying to show from the calculated column as below.

FinalActual = if('Sales Target'[SalesRep] = "ABC",'Sales Target'[totalABC],'Sales Target'[totalseats]-'Sales Target'[totalseatspq] )
 
so I am trying to show the actual value based on the sales rep name. if the sales rep name is "ABC", then it should show the value of the measure which i created seperately. for others it should be Sales Target'[totalseats]-'Sales Target'[totalseatspq]. But the issue here is, for ABC its not taking the value from the "true condition(Sales Target'[totalABC])" of if statement. its still picking the value of the false condition(Sales Target'[totalseats]-'Sales Target'[totalseatspq]). Please help if i am missing anything here.
 
Your help is highly appreciated

 

 

3 REPLIES 3
jaipal
Resolver III
Resolver III

hi,@Anonymous , if Sales Target[totalABC is a measure, try and make this as column and see  how it goes

Anonymous
Not applicable

@jaipal i tried that. but that also didnt work. when i use that measure seperately in the visual, its showing the correct answer. but with the if statement its not giving me right

unnipbi123_0-1643799838275.png

 

 

Hi, @Anonymous 

 

The problem is not with the if statement, but with the measure inside you. I don't know which ones you use are measures and which are calculated columns, in short, the two can't be mixed. And you only put a matrix screenshot, we don't even know what the data is like, and your complete formula, how can we help you?

If you still need help, please provide a data sample and your complete needs and results, otherwise we can't get involved at all. 

 

Janey

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