Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Order visuals with text data using a index column

Hello

 

I'm working with some CRM data and I have to create a pipeline visualization.

This means that I need to order a column that as text data like Negotiation, Proposal, Analysis and Commit.

 

I've tried to create a column that as a SWITCH case for each of those values, I'm using this code:

 
 SWITCH([pipeline_steps],
                "Qualification", 1,
                "Needs Analysis", 2,
                "Proposal", 3,
                "Negotiation", 4,
                "Commit", 5)
 
However, I don't think this is a good solution because:
  • How to order visuals? I need to insert this column aside the pipeline_steps and its a mess;
    •  

  • Some visuals doesn't even works with that

 

Any alternatives?

Maybe I can create a calculated table that is ordered by the pipeline_steps columns? I can't really understand how ORDERBY works. 

  • Hi, create a conditional column in Power Query with the corresponding numbers. Hence that sorting column would contain 1 when value is Qualification, 2 when Needs Analysis and so on. Once done, then sort by another column. When you click on your "pipeline_steps" column, at top Column tools would open. in Sort by column, choose that sorting column you created in Power Query.
    Now you may use pipeline_steps and it would be sorted.

    If this resolves your proble, then mark it as solution, thanks

2 Replies

  • Hi, create a conditional column in Power Query with the corresponding numbers. Hence that sorting column would contain 1 when value is Qualification, 2 when Needs Analysis and so on. Once done, then sort by another column. When you click on your "pipeline_steps" column, at top Column tools would open. in Sort by column, choose that sorting column you created in Power Query.
    Now you may use pipeline_steps and it would be sorted.

    If this resolves your proble, then mark it as solution, thanks

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi samratpbi 

       

      Can you elaborate on this solution perfomance? 

      Is it a good pratice to create columns in Power Query as needed? I'm pulling data from Big Query. 

       

      This solution works and solves my question, but I want to understand better if this is a thing that I can do everytime I need to adjust data.

       

      I'm trying to get better at this.