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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

IF Statement - Power BI Desktop

Hi everyone,

 

 

 I have a simple question and wantes some assitance. I have two columns (Reference Status and Date) in my dataset and wanted to create a simply IF statement. I want the IF statement to be "IF Reference Status = No, then display Date, otherwise display blank".

 

 Do I have to create a Custom Column for this IF Statement? Any help would be sincerely apprecated as I am new to Power BI.

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@Anonymous if you want to do this in Table View (after you've imported your Data) you use DAX like so

 

DAX => New Column = IF ( [Reference Status]="No", [Date], BLANK() )

 

if you want to do this during import in the Query Editor (just follow the picture)

Give the Column a Name and the conditions - the Query Editor will genetrate the column in M which is

M => if [Reference Status] = "No" then [Date] else ""

 

Conditional Column PQ.png

View solution in original post

5 REPLIES 5
Sean
Community Champion
Community Champion

@Anonymous if you want to do this in Table View (after you've imported your Data) you use DAX like so

 

DAX => New Column = IF ( [Reference Status]="No", [Date], BLANK() )

 

if you want to do this during import in the Query Editor (just follow the picture)

Give the Column a Name and the conditions - the Query Editor will genetrate the column in M which is

M => if [Reference Status] = "No" then [Date] else ""

 

Conditional Column PQ.png

Is there a way to create an IF statement based on the value of another table? For example, IF "Blah Table" = a value in "Blah Blah table" then return the value of "Compliant"...

 

Basically trying to have a column that says whether or not an application's version is "In Compliance"... but I want the unit, that is being measured, to be a separate table that is kept updated on its own.

 

Sorry if this makes no sense at all.... I will try my best to better explain myself if necessary.

 

I was able to get the IF statement working, if I manually entered the version, but I would like to get the version from another table, due to the fact that this is an application that has several modules that have to be kept updated on a regular basis.

 

If I can enter my values into a separate table and have that be my 'control' for the IF statement "true" portion, that would be amazing.

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
msalam
Frequent Visitor

I'm receiving this error in my DAX query on calculated column as follows:

 

Column = IF(Reading[ServiceId]=1, Reading[Value] , "On")

 

ERROR:

Function 'IF' is not allowed as part of calculated column DAX expressions on DirectQuery models

 

Any Idea why i'm receiving that error?

Anonymous
Not applicable

Thank you for this..... Worked like a charm. Sincerely appricate it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.