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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Create Bins/Groups by Selected Date Slicer

Hi, I have hierarchical date slicer that shows date as Year->Quarter->Month (Table1[Created Date]).


On X-axis, I have month count calculated as  'Table1[Created Date] - Date(2014,1,1). So, month count is 1,2,3...12,13,14...till current month. Now, based on the date selected in slicer, I want to generate different Month count bins on x-axis such that first bin always starts with month selected in the slicer and all other bins should show current month count + 12.

Here are some examples: 


Created DateBin1Bin2Bin3

I was able to create bins using calculated column but they wont dynamically change based on the slicer selected date/month. 


Any help would be appreciated. Thanks

Super User
Super User

@NT2510 You would have to create your bins as measures. Then you would most likely need to use the disconnected table trick in some fashion, not exactly clear on your requirements though. 


Sorry, having trouble following, can you post sample data as text and expected output?

Not really enough information to go on, please first check if your issue is a common issue listed here:

Also, please see this post regarding How to Get Your Question Answered Quickly:

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I am newbie and not sure how to upload file directly.

Here is the expected output. Date filter can be selected for multiple dates but I want only MAX(Month(Created Date)) which will be used for 1st bin.

Currently I have hardcoded max value as "5" hence 1st bin starts with 5. My only problem is, how I can pass Max of Created Date to calculated column or measure. I tried selectedvalue but it does not pass Max value instead all values.

Is there any way I can get Max value to pass so that bins can dynamically created.






@NT2510 , You can upload to onedrive or drop box and share link

Super User
Super User

@NT2510 , Typically these bins are created on diff like


diff= Datediff(max([Created Date]) , seleteddate(Date[Date]), Day)


Now I can bin this measure. So I can get like 1,3 , 2-6 month etc and have count for that.


Something like this

Measure =
countx(filter(values(Table[Created_date]),diff <=max(Bin[Bin end]) && diff >=max(Bin[Bin start])),Table[ID])


or you need like

Measure =
var _1 = countx(filter(values(Table[Created_date]),diff <=max(Bin[Bin end]) && diff >=max(Bin[Bin start])),Table[ID])
Switch ( True (),
_ <=3 , "0-3",
_ <=5 , "3-4",
////And so on


So not able to get you when you want bin returned by measure.


Also refer these





Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

Top Solution Authors