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! Request now

Reply
AC23VM
Helper II
Helper II

Measure for combining multiple months into one?

Hi there.  I've made a clustered column chart that shows the top 5 from a set of values over the past 3 months.  With a date column forming my X axis, I end up with 3 sets of 5 columns - the top 5 in Oct, the top 5 in Nov, and the top 5 in Dec.  Is there a quick win to combine these together, so the chart shows just 5 columns, as opposed to 15?  I'm not sure if something like a date measure for 'last 3 months' exists, and if it would work for an X axis - hopefully that makes sense.

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @AC23VM 

 

you can try these formula

Column =
VAR CurrentDate =
    DATE ( 2017, 12, 31 )
VAR StartingPoint =
    EOMONTH ( CurrentDate, -3 ) + 1
RETURN
    Table1[Date]
    >= StartingPoint
    && Table1[Date] <= CurrentDate

OR

 

CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH)

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

2 REPLIES 2
Uzi2019
Super User
Super User

Hi @AC23VM 

 

you can try these formula

Column =
VAR CurrentDate =
    DATE ( 2017, 12, 31 )
VAR StartingPoint =
    EOMONTH ( CurrentDate, -3 ) + 1
RETURN
    Table1[Date]
    >= StartingPoint
    && Table1[Date] <= CurrentDate

OR

 

CALCULATE(distinctCOUNT('Date'[Month Year]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-3,MONTH)

 

I hope I answered your question!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
danextian
Super User
Super User

Hi @AC23VM 

 

It would easier for us to provide a working or near-working solution if you posted a workable sample data (not an image), your expected result from the same sample data and the reasoning behind. Also, what column are you ranking? Top 5 what based on what value?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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