Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Numbers to text and dates

I get my data from Mycrosoft Dynamics. How can I change the second and third columns below. 

 

For the second is fequency: 

if 100000 = quarterly 

if 100001 = six-month 

if 100002 = annually 

 

For the 3rd column: Each number is a month. 

How can I change

If =1 then January,

if =2, then February and so on.... 

 

 

Thanks!!! 

  • Anonymous's avatar
    Anonymous
    3 years ago

    You can add two columns like:

     

    = Table.AddColumn(PriorStepOrTableName, "Frequency", each if [ax_reviewfrequency] = "10000000" then "quarterly" else if [ax_reviewfrequency] = "10000001" then "six-month" else "annually", type text)

     

    = Table.AddColumn(PriorStepOrTableName, "Month Name", each Date.MonthName(#date(1, [ax_annualistheendof], 1)), type text)

     

    --Nate

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can add two columns like:

     

    = Table.AddColumn(PriorStepOrTableName, "Frequency", each if [ax_reviewfrequency] = "10000000" then "quarterly" else if [ax_reviewfrequency] = "10000001" then "six-month" else "annually", type text)

     

    = Table.AddColumn(PriorStepOrTableName, "Month Name", each Date.MonthName(#date(1, [ax_annualistheendof], 1)), type text)

     

    --Nate

    • Anonymous's avatar
      Anonymous
      Not applicable

      Many thanks Anonymous  😁

       

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous Maybe calculated columns like:

    Frequency Column = 
      SWITCH([ax_reviewfrequency],
        100000,"quarterly",
        100001,"six-month",
        "annually"
      )