Forum Discussion

dommyw277's avatar
dommyw277
Helper V
9 months ago
Solved

Create long Month Name

Hi, i dont have a month column so i split the file name into two eg each file is named dataaug25, datasept25 etc. So now i have 2 columns, one called month eg aug, sept and the other is year. How do...
  • bhanu_gautam's avatar
    9 months ago

    dommyw277 

    You can create a new column in Power BI with the full month name by using the Power Query Editor or DAX.

    Go to Transform Data.
    Select your table.
    Add a new column using "Add Column" > "Custom Column".
    Use a formula like this:

    powerquery
    = if [month] = "jan" then "January"
    else if [month] = "feb" then "February"
    else if [month] = "mar" then "March"
    else if [month] = "apr" then "April"
    else if [month] = "may" then "May"
    else if [month] = "jun" then "June"
    else if [month] = "jul" then "July"
    else if [month] = "aug" then "August"
    else if [month] = "sep" or [month] = "sept" then "September"
    else if [month] = "oct" then "October"
    else if [month] = "nov" then "November"
    else if [month] = "dec" then "December"
    else [month]

     

    For DAX 

    dax
    Full Month Name =
    SWITCH(
    TRUE(),
    [month] = "jan", "January",
    [month] = "feb", "February",
    [month] = "mar", "March",
    [month] = "apr", "April",
    [month] = "may", "May",
    [month] = "jun", "June",
    [month] = "jul", "July",
    [month] = "aug", "August",
    [month] = "sep" || [month] = "sept", "September",
    [month] = "oct", "October",
    [month] = "nov", "November",
    [month] = "dec", "December",
    [month]
    )