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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JMWDBA
Advocate II
Advocate II

True and False with unrelated fields

So I know how to use the True and False clause when the values between two fields are equal and when they are not equal but I am unsure if its possible to use the True/False by validating parameters between two columns that have different values.  

 

Example when you look at the below table, I am focused on Column BL "Term Military Civilian Type Descr" and Column BN "Term Military Status"

 

I want to be able to say:

 

Military Rate = IF ('Registrations'[Term Military Civilian Type Descr] is Civilian and ('Registrations'[Term Military Status]) is blank then label as "No Military Rate", else label as "Military Rate".

 

But I dont quite know the DAX for this approach of if its even possible. 

 

2017-07-12_13-28-32.jpg

1 ACCEPTED SOLUTION

Hi @JMWDBA,

 

A little weird. The formula should work. Could you try the formula below to see if it works? Smiley Happy

Military Rate =
IF (
    'Registrations'[Term Military Civilian Type Descr] = "Civilian"
        && (
            ISBLANK ( 'Registrations'[Term Military Status] )
                || 'Registrations'[Term Military Status] = ""
        ),
    "No Military Rate",
    "Military Rate"
)

 

Regards

View solution in original post

5 REPLIES 5
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @JMWDBA,

Military Rate = IF ('Registrations'[Term Military Civilian Type Descr] is Civilian and ('Registrations'[Term Military Status]) is blank then label as "No Military Rate", else label as "Military Rate".

 

But I dont quite know the DAX for this approach of if its even possible.



You should be able to use the formula(DAX) below to create a calculate column in this scenario. Smiley Happy

Military Rate =
IF (
    'Registrations'[Term Military Civilian Type Descr] = "Civilian"
        && ISBLANK ( 'Registrations'[Term Military Status] ),
    "No Military Rate",
    "Military Rate"
)

 

Regards

For some reason it labels all of them as "Military Rate" based on the formula you provided instead of labeling those with Civilian and IS Blank in the Term Military Status Field as "No Military Rate"

Hi @JMWDBA,

 

A little weird. The formula should work. Could you try the formula below to see if it works? Smiley Happy

Military Rate =
IF (
    'Registrations'[Term Military Civilian Type Descr] = "Civilian"
        && (
            ISBLANK ( 'Registrations'[Term Military Status] )
                || 'Registrations'[Term Military Status] = ""
        ),
    "No Military Rate",
    "Military Rate"
)

 

Regards

That worked like a charm!!! You are heaven-sent!!!Smiley LOL

Anonymous
Not applicable

DAX has AND() and BLANK(), which should be all you need to finish that statement.

 

You might consider doing this in M instead, before your data is loaded. You could use a natural "someList = if condition and condition then result else result" (pseudocode).

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.