Forum Discussion

trevorw1329's avatar
trevorw1329
Regular Visitor
4 years ago
Solved

New Column - Using related function "parameter is not the correct type"

Hi,

I am trying to create a new column in order to calculate the distance between locations using latitude and longitude. To do this I created a new column under one sheet and used the related function in dax to get a column from another sheet. This seemed to work at first but as I continued that line it gave an error message shown below.I'm sure that I'm not going about this correctly in some way. It wouldn't accept the field regardless of if it was text or numerical. Would love to hear other ways to troubleshoot this, thanks so much for any help! I also attached a photo below showing that this field appeared after entering the function so it seems to have some ability to connect.

  • I'm not sure this is the extent of the problem you are facing, but at the very least you need a closing parentheses after Active_Nonprofit_Network[NPO].

    Distance = ACOS(SIN(RELATED(Active_Nonprofit_Network[NPO]) * PI()/180)))

     

2 Replies

  • SunRiser's avatar
    SunRiser
    Regular Visitor

    I'm not sure this is the extent of the problem you are facing, but at the very least you need a closing parentheses after Active_Nonprofit_Network[NPO].

    Distance = ACOS(SIN(RELATED(Active_Nonprofit_Network[NPO]) * PI()/180)))

     

    • trevorw1329's avatar
      trevorw1329
      Regular Visitor

      Thank you, all good now! Haha not sure how this didn't occur to me