Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello!
I need to change the variable of an api I'm working on from text to date, the code is in DAX, how do I do it?
I would like to create a variable that identifies the current date, in this case today, and another variable that is the date current -35 days, so that I can do an update automatically, but to do this I believe that I must first
being able to convert the Day field into date format and not Text It is currently in Text format
@alinesilva2
What you are sharing is the "M" code in Power Query. The Date,ToText function is correct. Is question regarding how to do the same in DAX then
FORMAT ( Table[Date] , "yyyy-mm-dd" )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi!
I would like to create a variable that identifies the current date, in this case today, and another variable that is the date current -35 days, so that I can do an update automatically, but to do this I believe that I must first
being able to convert the Day field into date format and not Text It is currently in Text format
@alinesilva2
Share some sample date format in text, I will show how to convert it.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
My problem is in this part of the code
@alinesilva2
Please provide explanation and the expected result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Currently I have a field called "DAY" and this field is configured as text type in my API (which is
my data source), I need to convert this field which is in the format YYYY-MM-DD (text) to DD/MM/YYY (date), as
This way I can automate my query.
Below is an example of one of my attempts to create these variables.
In this case, the period of time I need is from the day before the current day to 35 days before the current day, in order to have the
Automatic Update.
@alinesilva2
If you date is in text as yyyy-mm-dd then just chagne the data type to date:
You get the result
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |