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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
WJ876400
Helper IV
Helper IV

If statement with different data types

Hi

 

I want to create a new column or measure that looks at two colums with different data types and returns a value.

 

I want to re create the below. The start year is TEXT and the progression Target is decimal number. I want the progression column to populate based on -

 

If the start year is 2016/17 then return NA or blank, if it is anything else return the progression target. Any help would be appreciated, thank

 

 
Start YearProgression TargetProgression
2016/175.6NA
2016/172.8NA
2016/173.7NA
2017/187.57.5
2018/195.25.2
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@WJ876400 You are missing second argument of format function 

try this

IF(learners[ACADEMIC START YEAR]="2016-2017","NA",FORMAT(Learners[OJT_Target.CURRENT OJT TARGET],""))

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

@WJ876400 

Column = IF('Table'[Start Year]="2016/17","NA",FORMAT('Table'[Progression Target],""))

Hi @Anonymous  i tried that but get the following error

 

Capture.PNG

Anonymous
Not applicable

@WJ876400You forgot the "" in the FORMAT function second argument.

Anonymous
Not applicable

@WJ876400 You are missing second argument of format function 

try this

IF(learners[ACADEMIC START YEAR]="2016-2017","NA",FORMAT(Learners[OJT_Target.CURRENT OJT TARGET],""))

thanks very much that worked

Anonymous
Not applicable

Hi @WJ876400 ,

 

Is that a single DB table?

 

BR,

DR

Hi

 

It is from two spreadsheets merged in the query

 

thanks

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.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.