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

Disconnected Time Dimension - count number of months

Hello friends,

I need to build a measure that calculates the number of months in the context of CalendarTable (disconnected)

So, if a user filters on a year - it will return 12, if a user filters on a quater, then - 3, month - 1

Please help with the logic

Thanks

Michael

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,


I need to build a measure that calculates the number of months in the context of CalendarTable (disconnected)

So, if a user filters on a year - it will return 12, if a user filters on a quater, then - 3, month - 1

 


Do you mean the "Year", "Quarter" and "Month" column you're using as Slicers/Filters are from a different table(not the Calendar table)? Could you post some sample data for this table?

 

What if a user just filters on a month without selecting a specific Year or Quarter? Could you be more precisely with the logic you want to calculate the number of months? Smiley Happy

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,


I need to build a measure that calculates the number of months in the context of CalendarTable (disconnected)

So, if a user filters on a year - it will return 12, if a user filters on a quater, then - 3, month - 1

 


Do you mean the "Year", "Quarter" and "Month" column you're using as Slicers/Filters are from a different table(not the Calendar table)? Could you post some sample data for this table?

 

What if a user just filters on a month without selecting a specific Year or Quarter? Could you be more precisely with the logic you want to calculate the number of months? Smiley Happy

 

Regards

Anonymous
Not applicable

Thank you @v-ljerr-msft

I have just realized that I can use a simple DISTINCTCOUNT(CalendarTable[YearMonth]) since it is not connected to Fact

Thanks :)!

Michael

BhaveshPatel
Community Champion
Community Champion

Hi Micheal,

 

Please refer to the below blogpost by Rob collie oon Disconnected tables in Time calculations.

 

https://powerpivotpro.com/2013/06/simplifying-time-calculations-and-the-user-experience-using-discon...

 

 

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Anonymous
Not applicable

@BhaveshPatel Thanks, but it doesn't reffer to my question.

I know how to create a disconnected time dimension.

I am asking for help on how to calculate a number of months.

So I need help with the logic for this specific measure.

Thank you!

Michael

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