Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

remove leading comma from measure

I used a measure to concate and comma separate 

Step 1) I created custom column   PartyName = Related(contacts(fullname)) .

step 2 ) Created measure = 

 Name = CONCATENATEX(VALUES(activityparties[PartyName]),activityparties[PartyName],", ")

It shows correct data, but I am getting an extra comma at begining of data. 
, Robert David, David Shaw, Morning Evening, Johnathon Arnold, Leslie Fejes

I tried to use Mid function, but after editing formula, visual keeps loading for some time and then shows error msg saying runs out of memory.. 

Any clue on this?? 

Kind Regards,
Ashay

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    Hi akshay,


    You need to create calculated column for this.

     

    You can also use concatenatex function for same.

     

     




    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit, 
      Thanks for your reply. 
      That is not the case I am doing. 

      I have 4 tables, 1) activitypointers, 2) activityparties 3)incident 4) contacts

       

      My current table visual is like this 

      Ticket Number(incident)Activityid (activitypointer)partyid(activityparty)contact
      1axxname
      1ayyname
      1azzname
      2bbbname
      3a1x1x1nam
      3a2x2x2name

       

      All I am expecting it to be is

      ticketnmbercontact
      1xname, yname, zname
      2bname
      3x1name, x2name

       

      But my result is like 
      1   ,xname, yname, zname. 

      I want to removve first comma. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Akshay,

        Your formula is correct, Even, I am also getting the same result.

         

         

        I think, You have to clean Conatct column in Power Query Editor

        =Text.TrimStart(Text.TrimStart([contact],","))

         

        Then you can use this custom column in Power BI desktop to create measure.

         

        Thanks,
        Amit