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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nasirali
Helper I
Helper I

How to Change Line Chart X-asix Month Language

Hi,

 

 

I am developing a report where i am showing cost by months in a line Chart with months on X-Axis and cost on Y-Axis. Everything is working fine. My question is, how can i change the months name from English to German. Capture.PNG

 

1 ACCEPTED SOLUTION
tuomo_kareoja
Frequent Visitor

When you create report in certain language version of Power BI, the automatic month and day names will always be in this language even if you open the report in different language version. There is no way to change this at the moment.

 

If you would not like to create the report again in German version of Power BI, there is way around this.

 

You need to create a separate Date-table that has the right kind of month names and then use this field as the X-axis. The date table can be easily created in the query editor.

 

1. Go to query-editor
2. Select New Source and from there Blank Query
3. Select Advanced Editor and copypaste this code on top of the default:
 
 
let CreateDateTable = (StartDate as date, EndDate as date, optional Culture as nullable text) as table =>
  let
    DayCount = Duration.Days(Duration.From(EndDate - StartDate)),
    Source = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),
    TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),
    ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type date}}),
    RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Date"}}),
    InsertYear = Table.AddColumn(RenamedColumns, "Year", each Date.Year([Date])),
    InsertQuarter = Table.AddColumn(InsertYear, "QuarterOfYear", each Date.QuarterOfYear([Date])),
    InsertMonth = Table.AddColumn(InsertQuarter, "MonthOfYear", each Date.Month([Date])),
    InsertDay = Table.AddColumn(InsertMonth, "DayOfMonth", each Date.Day([Date])),
    InsertDayInt = Table.AddColumn(InsertDay, "DateInt", each [Year] * 10000 + [MonthOfYear] * 100 + [DayOfMonth]),
    InsertMonthName = Table.AddColumn(InsertDayInt, "MonthName", each Date.ToText([Date], "MMMM", Culture), type text),
    InsertCalendarMonth = Table.AddColumn(InsertMonthName, "MonthInCalendar", each (try(Text.Range([MonthName],0,3)) otherwise [MonthName]) & " " & Number.ToText([Year])),
    InsertCalendarQtr = Table.AddColumn(InsertCalendarMonth, "QuarterInCalendar", each "Q" & Number.ToText([QuarterOfYear]) & " " & Number.ToText([Year])),
    InsertDayWeek = Table.AddColumn(InsertCalendarQtr, "DayInWeek", each Date.DayOfWeek([Date])),
    InsertDayName = Table.AddColumn(InsertDayWeek, "DayOfWeekName", each Date.ToText([Date], "dddd", Culture), type text),
    InsertWeekEnding = Table.AddColumn(InsertDayName, "WeekEnding", each Date.EndOfWeek([Date]), type date)
  in
    InsertWeekEnding
in
  CreateDateTable
 
 
4. After you hit OK, there is a graphical interface where you tell where the calender should start and end. Importantly there is also a Culture-field that lets you decide the language for the month and day names in the calender
 
German = "De"
 
5. Connect Date-table to your data-table by date and use the German month-field from the Date table in your picture.
 
PS: Huge kudos to dkay84_PowerBI for pointing this method out.

View solution in original post

2 REPLIES 2
tuomo_kareoja
Frequent Visitor

When you create report in certain language version of Power BI, the automatic month and day names will always be in this language even if you open the report in different language version. There is no way to change this at the moment.

 

If you would not like to create the report again in German version of Power BI, there is way around this.

 

You need to create a separate Date-table that has the right kind of month names and then use this field as the X-axis. The date table can be easily created in the query editor.

 

1. Go to query-editor
2. Select New Source and from there Blank Query
3. Select Advanced Editor and copypaste this code on top of the default:
 
 
let CreateDateTable = (StartDate as date, EndDate as date, optional Culture as nullable text) as table =>
  let
    DayCount = Duration.Days(Duration.From(EndDate - StartDate)),
    Source = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),
    TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),
    ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type date}}),
    RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Date"}}),
    InsertYear = Table.AddColumn(RenamedColumns, "Year", each Date.Year([Date])),
    InsertQuarter = Table.AddColumn(InsertYear, "QuarterOfYear", each Date.QuarterOfYear([Date])),
    InsertMonth = Table.AddColumn(InsertQuarter, "MonthOfYear", each Date.Month([Date])),
    InsertDay = Table.AddColumn(InsertMonth, "DayOfMonth", each Date.Day([Date])),
    InsertDayInt = Table.AddColumn(InsertDay, "DateInt", each [Year] * 10000 + [MonthOfYear] * 100 + [DayOfMonth]),
    InsertMonthName = Table.AddColumn(InsertDayInt, "MonthName", each Date.ToText([Date], "MMMM", Culture), type text),
    InsertCalendarMonth = Table.AddColumn(InsertMonthName, "MonthInCalendar", each (try(Text.Range([MonthName],0,3)) otherwise [MonthName]) & " " & Number.ToText([Year])),
    InsertCalendarQtr = Table.AddColumn(InsertCalendarMonth, "QuarterInCalendar", each "Q" & Number.ToText([QuarterOfYear]) & " " & Number.ToText([Year])),
    InsertDayWeek = Table.AddColumn(InsertCalendarQtr, "DayInWeek", each Date.DayOfWeek([Date])),
    InsertDayName = Table.AddColumn(InsertDayWeek, "DayOfWeekName", each Date.ToText([Date], "dddd", Culture), type text),
    InsertWeekEnding = Table.AddColumn(InsertDayName, "WeekEnding", each Date.EndOfWeek([Date]), type date)
  in
    InsertWeekEnding
in
  CreateDateTable
 
 
4. After you hit OK, there is a graphical interface where you tell where the calender should start and end. Importantly there is also a Culture-field that lets you decide the language for the month and day names in the calender
 
German = "De"
 
5. Connect Date-table to your data-table by date and use the German month-field from the Date table in your picture.
 
PS: Huge kudos to dkay84_PowerBI for pointing this method out.
bsas
Post Patron
Post Patron

Hi @nasirali,

 

You need to use function SWITCH which create responsible text values for eng months and then create index column to sort this values in right rank. 

 

MonthNum = SWITCH('Table1'[Month],"Jan","germ name,"Feb","germ name,"Mar","germ name"....)

MonthIndex = Date.[Year] * 100 + Date.[MonthNo]

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.