Forum Discussion
Arabic months name
- Anonymous5 years ago
Hi pbiadenhostacc ,
I'm sorry that the formula I gave is wrong.
The reason for the error is because FORMAT returns a text format, and the SWITCH below judges that the 1 in Month_Name = 1 is a number type.
This is the new calculated column I tested.
Column = VAR Month_Name = FORMAT ( [Date], "mm" ) RETURN SWITCH ( TRUE (), Month_Name = "01", "كانون الثاني", Month_Name = "02", "شهر فبراير", Month_Name = "03", "مارس", Month_Name = "04", "أبريل", Month_Name = "05", "مايو", Month_Name = "06", "يونيو", Month_Name = "07", "يوليو", Month_Name = "08", "أغسطس", Month_Name = "09", "سبتمبر", Month_Name = "10", "اكتوبر", Month_Name = "11", "شهر نوفمبر", Month_Name = "12", "ديسمبر" )You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pbiadenhostacc ,
You may try to create one calculated column to replace the old column with same name.
Column =
var Month_Name = FORMAT( 'date_field'[date] "mm" )
RETURN SWITCH( TRUE(),
Month_Name=1, "كانون الثاني"
Month_Name=2,"شهر فبراير"
.
.
etc
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Stephen,
Ok brother . I will try it.
Thanks A lot.
- pbiadenhostacc5 years agoNew Member
Hi Stephen,
sorry brother but I treid ur code and got some errors!!
but when I changed column data type to TEXT, It works but I have to keep the field data type as a date because I use some date function (MoM% - YoY%) with this field.
المبلغ average per المحافظة average per Month MoM% =IF(ISFILTERED('السلة الغذائية'[entdate]),ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),VAR __PREV_MONTH =CALCULATE([المبلغ average per المحافظة average per Month],DATEADD('السلة الغذائية'[entdate].[Date], -1, MONTH))RETURNDIVIDE([المبلغ average per المحافظة average per Month] - __PREV_MONTH,__PREV_MONTH))Thanks alote
- Anonymous5 years agoNot applicable
Hi pbiadenhostacc ,
I'm sorry that the formula I gave is wrong.
The reason for the error is because FORMAT returns a text format, and the SWITCH below judges that the 1 in Month_Name = 1 is a number type.
This is the new calculated column I tested.
Column = VAR Month_Name = FORMAT ( [Date], "mm" ) RETURN SWITCH ( TRUE (), Month_Name = "01", "كانون الثاني", Month_Name = "02", "شهر فبراير", Month_Name = "03", "مارس", Month_Name = "04", "أبريل", Month_Name = "05", "مايو", Month_Name = "06", "يونيو", Month_Name = "07", "يوليو", Month_Name = "08", "أغسطس", Month_Name = "09", "سبتمبر", Month_Name = "10", "اكتوبر", Month_Name = "11", "شهر نوفمبر", Month_Name = "12", "ديسمبر" )You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- pbiadenhostacc5 years agoNew Member
THANKS BROTHER!!