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

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

Top Solution Authors
Top Kudoed Authors