Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Erika16
Helper II
Helper II

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.... 

 

 

Erika16_0-1673539845033.png

Thanks!!! 

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

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


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

3 REPLIES 3
watkinnc
Super User
Super User

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


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Many thanks @watkinnc  😁

 

Greg_Deckler
Super User
Super User

@Erika16 Maybe calculated columns like:

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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors