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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Trouble with IF statement

Hi all,

 

Fairly new to Power BI and DAX so I was hoping someone might be able to help me out here. I'm currently trying to create an IF statement using a field and it's not co-operating. The field is in the screenshot below, it's basically a list of job titles - I want the IF statement to say something along the lines of 

 

if(Rate[JobTitle]="AccountsPayable" && Rate[Pay_Rate]<=15.83,15.79, 15.00, BLANK)
 
However, the IF statement only appears to accept Measures and won't allow me to input JobTitle as a field. Could someone help explain to me why this is, and perhaps how I can work around it?
 
My first instinct was that I was required to create a calculated column, but as I am connected directly to a database my understanding is that this is not possible.
 
Thannks so much!

 

custerdome_0-1658134102222.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

My test table:

vbinbinyumsft_0-1658397403428.png

 

Please try below steps:

1.Create a measure

Measure =
VAR cur_jobtitle =
    MAX ( 'Rate'[JobTitle] )
VAR cur_payrate =
    MAX ( 'Rate'[Pay_Rate] )
RETURN
    IF ( cur_jobtitle = "Accounts Payable" && cur_payrate <= 45, 15.79, 15.00 )

2.Visualize data with table visual

vbinbinyumsft_1-1658397488321.png

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

My test table:

vbinbinyumsft_0-1658397403428.png

 

Please try below steps:

1.Create a measure

Measure =
VAR cur_jobtitle =
    MAX ( 'Rate'[JobTitle] )
VAR cur_payrate =
    MAX ( 'Rate'[Pay_Rate] )
RETURN
    IF ( cur_jobtitle = "Accounts Payable" && cur_payrate <= 45, 15.79, 15.00 )

2.Visualize data with table visual

vbinbinyumsft_1-1658397488321.png

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Jos_Woolley
Solution Sage
Solution Sage

You could try the following measure:

MyMeasure =
VAR ThisJobTitle =
    MIN( 'Rate'[JobTitle] )
VAR ThisPayRate =
    MIN( 'Rate'[Pay_Rate] )
RETURN
    IF(
        ThisJobTitle = "AccountsPayable"
            && ThisPayRate <= 15.83,
        "Return This",
        "Return That"
    )

Regards

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.