Forum Discussion

WJ876400's avatar
WJ876400
Helper IV
6 years ago
Solved

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
  • Anonymous's avatar
    Anonymous
    6 years ago

    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],""))

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    WJ876400 

    Column = IF('Table'[Start Year]="2016/17","NA",FORMAT('Table'[Progression Target],""))
    • WJ876400's avatar
      WJ876400
      Helper IV

      Hi Anonymous  i tried that but get the following error

       

      • Anonymous's avatar
        Anonymous
        Not applicable

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

    • WJ876400's avatar
      WJ876400
      Helper IV

      Hi

       

      It is from two spreadsheets merged in the query

       

      thanks