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 ,
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)
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:
- adudani2 years agoMemorable Member
Alternatively,
with the "DimDate" i provided in the sample output previously.
you could also modify the start and end date as shown below in the advanced editor
- gbarr123452 years agoPost Prodigy
Perfect thanks, that worked!
One more question, I copied your relationships, etc and for some reason the numbers for the depletion are still the same instead of giving me the correct number:
Any idea as to why that's happening?
- adudani2 years agoMemorable Member
is the "Date" in the row context from "DimDate" ?
Also, is DimDate marked as the Date table?