Forum Discussion
Format DirectQuery Data as Currency
For DirectQuery mode in PowerBI, you lose the ability to format the data. My data source is an azure sql database. Is it possible to somehow tell PowerBI that you want a specific field to be formatted as currency? I was wodering if maybe it was possible to add some hint in the sql code to that would tell PowerBI it should be currency. For example, if I explicitly format the field as numeric then PowerBI enherits the data type. However, I can not think of how to do this for currency. I tried mondey in T-SQL, and that did not work (but maybe I did something wrong...). I tried converting it to text on the T-SQL side and added in '$' and commas in the output, but PowerBI interpreted it as text, which I expected. How do I get PowerBI data to format as currency while in DirectQuery mode?
Hi,
I am not sure what could be wrong here. But, it is possible to change the format even in DirectQuery mode by selecting the Modelling ribbon menu -> Format -> Currency.
- Anonymous10 years ago
So, the solution was decribed by Mi2n.
You select the measure you want to change format, in the modelling (or modeler I don't know I'm using the french Power BI desktop version) :
you select the format change and choose currency with the region you want.
Sébastien
7 Replies
- Mi2nMicrosoft Employee
Hi,
I am not sure what could be wrong here. But, it is possible to change the format even in DirectQuery mode by selecting the Modelling ribbon menu -> Format -> Currency.
- jonculp85Frequent Visitor
Mi2n - Can you ellaborate? While in DirectQuery mode there is no "Data" section which is where you would normally apply formatting changes using the modeling tab in the ribbon.
- AnonymousNot applicable
Hello jonculp85
you're right, since you use Direct Query with Sql you cannot change the datatype on Power Bi desktop. Here is what you should have :
But, if you click "Modifiy Query", in Power Query you should be able to change the datatype. I've managed to do it with Direct Query and Sql Server.