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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ASuhaji
Frequent Visitor

Column chart: Parameter to X-axis with date hierarchy

Hello Everyone,

 

I need your help with the following.

 

I want to create a dynamic slicer similar to the one shown in this video.

 

My problem is that one of the fields is a date column with date hierarchy. Currently, this is the related DAX code:

X-Axis = {
    ("Date", NAMEOF('Data'[Date])), 0),
    ("Supervisor", NAMEOF('Data'[Supervisor]), 1),
    ("Controller", NAMEOF('Data'[Controller]), 2)
}
 
The dynamic x-axis works perfectly with this too, the problem is that if I choose the date option, I get a breakdown by day and not the originally planned date hierarchy, where I can use the drill function.

 

Do you know of any way to solve it?

 

Thank you in advance.

2 ACCEPTED SOLUTIONS
ASuhaji
Frequent Visitor

I found a good solution for it.

 

This is how I changed the code of the parameter:

 

X-Axis = {
    ("Year", NAMEOF('Data'[Date].[Year]), 0),
    ("Quarter", NAMEOF('Data'[Date].[Quarter]), 1),
    ("Month", NAMEOF('Data'[Date].[Month]), 2),
    ("Day", NAMEOF('Data'[Date].[Day]), 3),
    ("Supervisor", NAMEOF('Data'[Supervisor]), 4),
    ("Regional Controller", NAMEOF('Data'[Controller]), 5)
}
 
After that I created 3 bookmarks which first state is the selected year, quarter, month, day fields, the second is only the supervisor, the third is the controller. Then I hid the related slicer and use only the bookmark navigator.

View solution in original post

ASuhaji
Frequent Visitor

I found a much simpler and more elegant solution:

 

X-Axis = {
    ("Year", NAMEOF('Data'[Date].[Year]), 0, "Date"),
    ("Quarter", NAMEOF('Data'[Date].[Quarter]), 1, "Date"),
    ("Month", NAMEOF('Data'[Date].[Month]), 2, "Date"),
    ("Day", NAMEOF('Data'[Date].[Day]), 3, "Date"),
    ("Supervisor", NAMEOF('Data'[Supervisor]), 4, "Supervisor"),
    ("Regional Controller", NAMEOF('Data'[Controller]), 5, "Regional Controller")
}
 
And I use the 4th column for the slicer.

View solution in original post

2 REPLIES 2
ASuhaji
Frequent Visitor

I found a much simpler and more elegant solution:

 

X-Axis = {
    ("Year", NAMEOF('Data'[Date].[Year]), 0, "Date"),
    ("Quarter", NAMEOF('Data'[Date].[Quarter]), 1, "Date"),
    ("Month", NAMEOF('Data'[Date].[Month]), 2, "Date"),
    ("Day", NAMEOF('Data'[Date].[Day]), 3, "Date"),
    ("Supervisor", NAMEOF('Data'[Supervisor]), 4, "Supervisor"),
    ("Regional Controller", NAMEOF('Data'[Controller]), 5, "Regional Controller")
}
 
And I use the 4th column for the slicer.
ASuhaji
Frequent Visitor

I found a good solution for it.

 

This is how I changed the code of the parameter:

 

X-Axis = {
    ("Year", NAMEOF('Data'[Date].[Year]), 0),
    ("Quarter", NAMEOF('Data'[Date].[Quarter]), 1),
    ("Month", NAMEOF('Data'[Date].[Month]), 2),
    ("Day", NAMEOF('Data'[Date].[Day]), 3),
    ("Supervisor", NAMEOF('Data'[Supervisor]), 4),
    ("Regional Controller", NAMEOF('Data'[Controller]), 5)
}
 
After that I created 3 bookmarks which first state is the selected year, quarter, month, day fields, the second is only the supervisor, the third is the controller. Then I hid the related slicer and use only the bookmark navigator.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.