Forum Discussion
How to convert SQL syntax to Dax
Is it possible to convert following command into Dax, in order to convert Georgian date into Hijri:
With respect to SQL Server 2012:
SQL Serverer 2012 introduces a new Format function that used to achieve the same result.
SELECT FORMAT ( GETDATE(), 'dd/MM/yyyy', 'ar-SA' )
Output
16/08/1435
Thanks in advance.
Regards,
M Shakir
HI v-xjiin-msft,
Thank you for taking part in my small request.
I will definitely share under IDEA.
My work around was simillar as suggested by yourself and other participant. Under excel, in one column I entered dates, convered them in Hijri and format them as Text, and connected this table to my Power BI Desktop, and relate them with the Date table.
This help me get the desired results.
11 Replies
- AnonymousNot applicable
- shakirkhananiHelper I
Thanks for the suggestion. Unfortunately it didnt work.
- AnonymousNot applicable
Could you try replace in Edit Query (screenshot attached), and see if it works?
- precedenceFrequent Visitor
I'm guessing the column isn't set to Data Type: Date
- v-xjiin-msftSolution Sage
Hi shakirkhanani,
As I know, currently we are using Georgian date format in Power BI Desktop no matter which region you are in. And it is unable to convert Georgian date into Hijri date within DAX. For the Hijri date format in Power BI, I would suggest you to submit an Idea here for a feature request.
Then in your scenario, if you still want to convert the date I would suggest you to do the work at SQL Server side and import the data into Power BI. But please be noticed that after converting, it is a text type value and is no longer a date type value.
Thanks,
Xi Jin.- shakirkhananiHelper I
HI v-xjiin-msft,
Thank you for taking part in my small request.
I will definitely share under IDEA.
My work around was simillar as suggested by yourself and other participant. Under excel, in one column I entered dates, convered them in Hijri and format them as Text, and connected this table to my Power BI Desktop, and relate them with the Date table.
This help me get the desired results.- v-xjiin-msftSolution Sage
Hi shakirkhanani,
Thanks for shareing us your solution. Please kindly mark it as answer. It will benefit others with the relevant issue. :smileyhappy:
Thanks,
Xi Jin.