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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
StevenT
Resolver I
Resolver I

Using drop down to change date settings in chart

Hi, I have two charts. The y-axis contains numerical values, and x-axis is a date hierarchy that contains the following from my calendar table

StevenT_2-1725638666615.png

Each one of these fields in the hierarchy are date fields, 
When I manually drill through in each of these charts I get the charts changing from month quarter and year. As expected.
Going forward I will have additional charts. each one will be using the same hierarchy.

Is there a way to create a way that a user can simply choose any of the three from a drop down and each selection, the charts change so the Y-axis changes from Month, quarter and year?

i tried it by using this code and then putting the first parameter in a drop down to choose, but my code is being ignored.

_X-Axis =
 //used only in the Calendar Drop down
 {
    ("Annually", NAMEOF('Calendar'[Start of Year]), 0),
    ("Monthly", NAMEOF('Calendar'[Start of Month]), 1),
    ("Quarterly", NAMEOF('Calendar'[Start of Quarter]), 2)
}


Any suggestions would be appreciated...
Thanks, Steve.

 

 

StevenT_0-1725638493633.png

 

4 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

Hi! When you create the below did you use the New parameter then fields from the Modeling ribbon or did you just type this directly in a new table? 

i tried it by using this code and then putting the first parameter in a drop down to choose, but my code is being ignored.

_X-Axis =
 //used only in the Calendar Drop down
 {
    ("Annually"NAMEOF('Calendar'[Start of Year]), 0),
    ("Monthly"NAMEOF('Calendar'[Start of Month]), 1),
    ("Quarterly"NAMEOF('Calendar'[Start of Quarter]), 2)
}




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

No, I just created it without adding any parameters against it.  I'll give it a try.

 

View solution in original post

Audrey, thanks so much! The key was creating it with the field parameter.  I tried importing the code from another app, and simply pasting it, changing the field names.  I forgot that this was created with field parameters

View solution in original post

You are very welcome! Happy I could help (guess how I suspected you pasted the code... been there done that 😂). Have a great weekend!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
audreygerred
Super User
Super User

Hi! When you create the below did you use the New parameter then fields from the Modeling ribbon or did you just type this directly in a new table? 

i tried it by using this code and then putting the first parameter in a drop down to choose, but my code is being ignored.

_X-Axis =
 //used only in the Calendar Drop down
 {
    ("Annually"NAMEOF('Calendar'[Start of Year]), 0),
    ("Monthly"NAMEOF('Calendar'[Start of Month]), 1),
    ("Quarterly"NAMEOF('Calendar'[Start of Quarter]), 2)
}




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Audrey, thanks so much! The key was creating it with the field parameter.  I tried importing the code from another app, and simply pasting it, changing the field names.  I forgot that this was created with field parameters

You are very welcome! Happy I could help (guess how I suspected you pasted the code... been there done that 😂). Have a great weekend!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





No, I just created it without adding any parameters against it.  I'll give it a try.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors