Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mm_4062
Frequent Visitor

Dynamic Date Selection for X-Axis - Include Fiscal Year & QTR options

I am using this code:

Dynamic Date Selections = UNION(ADDCOLUMNS(CALENDAR(MIN('Date Table'[Date]),MAX('Date Table'[Date])),"Visual Date",DATE(YEAR([DATE]),MONTH([Date]),1),"Type","Monthly","Order",1),ADDCOLUMNS(CALENDAR(MIN('Date Table'[Date]),MAX('Date Table'[Date])),"Visual Date",DATE(YEAR([DATE]),1,1),"Type","Yearly","Order",2))
 
To create a table that looks like:
DateExample.png
 
 
 
 
 
 
 
 
 
 
 
 
 
 
and an X-Axis date display selction tool that looks like:
DateTypeExample.png
 
 
 
 
 
 
Graph Ex.png
 
 
 
 
 
I am trying to add addtional options, such as Quarter (calendar year), Fiscal Year (July-Jun) and Fiscal QTR.  I have a date table with these options, but cannot figure out how I can add it to my options for the X-Axis dates.  Please help!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mm_4062 , Use the column in a date table joined with the date of your table, Try to create a field parameter for the Dynamic X axis

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...

 

 

Calendar = Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
)

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mm_4062 , Use the column in a date table joined with the date of your table, Try to create a field parameter for the Dynamic X axis

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...

 

 

Calendar = Addcolumns(calendar(date(2020,01,01), date(2021,12,31) ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
)

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

I wish I had known this existed! Would have saved me so much effort, THANK YOU! Now I just have to figure out how to make my line graph not show every single date from 1990-2050 😅

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.