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
Anonymous
Not applicable

Switch between 1 day and 1 month bin size for time axis from visual through slicer

Is there a way to create a slicer to change the bin size of the date axis of my visual between a bin of 1 month and 1 day?

 

Just like I would do the following:

-go to my visual

-right click on the date field in the axis section

-open the edit groups pane and change the bin from 1 month to 1 day / vica versa

 

-->But I would like to create a slicer to be able to select this option within the report.

 

Thanks in advance!

 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

You can replace the day field with the date field.

Remove Day.

 
 

image.png

And add Date

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

View solution in original post

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Normally you can use Date Hierarchy in Power BI.

https://5minutebi.com/2017/11/29/how-to-use-powerbi-date-hierarchy/.

If you want a slicer to let you chang options, you might to create a calculated table.

Please check the measure below.

Table 2 = 
UNION (
    SELECTCOLUMNS (
        'Table',
        "date", FORMAT ( 'Table'[date], "YYYY-MM-DD" ),
        "value", 'Table'[value],
        "type", "day"
    ),
    SELECTCOLUMNS (
        'Table',
        "date", FORMAT ( 'Table'[date], "YYYY-MM" ),
        "value", 'Table'[value],
        "type", "month"
    )
)

 Here's my raw data:

5.PNG

Here's the calculated table:

6.PNG

Then you can use the type column as a slicer to change the visual.

7.PNG

8.PNG

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
MFelix
Super User
Super User

Hi @Anonymous 

 

Check this solution from RADACAD with an option to change bin sizes, they are using ages but maybe can be adjust to what you need.

 

https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-count-of-bins

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can use drill up / down
https://docs.microsoft.com/en-us/power-bi/consumer/end-user-drill

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Hi Mariusz,

 

good proposal. It works out fine for years and months but if I drill down to days, PBI groups all days together without showing me the month or year.

So if I'm using a time span of 5 years and drill down to days, the x axes only shows me the number for the days (1-31) without the years and months..

 

 

Hi @Anonymous 

 

You can replace the day field with the date field.

Remove Day.

 
 

image.png

And add Date

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Sorry for my late reply and thanks Mariusz.

 

It is a solution, although not really a handy one, because as far as I know the drill down functionality can be set only for one visual, so there is no way to synchronize them.

Is there maybe any other way to achieve this with the help of a dropdown slicer? In my eyes this would be the most user friendly way..

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.