Forum Discussion
Help with Line Chart
- 2 years ago
hi gbarr12345 ,
this link has the code with variable start and end date:
avixd/CalendarTable_with_DAX: Code samples of a calendar table using DAX (github.com)
Change what is highlighted in yellow for the output:
hi gbarr12345 ,
Attached is my solution and an image of the output. Let me know if this meets the requirements.
steps taken:
1. added a date table.
2. Create 1 to many relationships from dimensions to facts.
3. Used the date from the date table instead of the depleation/usa table.
Thank you for your response.
How did you create the date table do you mind me asking?
- adudani2 years agoMemorable Member
hi gbarr12345 ,
references below have open source code.
using dax, you could create a new table and copy paste the dax code. Walk throughs of the code is in the videos.
Here is how to make it via DAX: Calendar Table using DAX (youtube.com)
Using a blank query, copy paste the code into the advanced editor in power query:
Power BI Ultimate Calendar Table 🗓️ / Date Table 📆 [ FREE DOWNLOAD ] (youtube.com)
- gbarr123452 years agoPost Prodigy
Thank you for your response.
I have this code for a Date column but I want it to start from the year 2020 and end in the year 2025. Is there a way to altewr my formula to do this do you know?
ADDCOLUMNS(
CALENDARAUTO(),
"Dates" , FORMAT([Date], "DD/MM/YYYY"),
"Year", YEAR([Date]),
"Month" , FORMAT([Date] , "mmmm"),
"Quarter" , FORMAT([Date] , "\QQ"),
"Month Year", FORMAT([Date], "mmm yyyy"),
"Day" , DAY([Date]),
"Month Number" , MONTH([Date])
)
- adudani2 years agoMemorable Member
hi gbarr12345 ,
this link has the code with variable start and end date:
avixd/CalendarTable_with_DAX: Code samples of a calendar table using DAX (github.com)
Change what is highlighted in yellow for the output: