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
PKPK90
Helper I
Helper I

Count of Weeks based on Date filter

Hi, I am trying to create a measure to show number of Weeks from Calendar table based on slicer date filter.
This is what I have done so far

CountWeeks = CALCULATEDISTINCTCOUNT('Calendar'[YearWeek]), FILTER(VALUES('Calendar'), 'Calendar'[Date]>=[Minimum date] && 'Calendar'[Date]<=[Maximum date]))
 
it is working fine in visuals like card or as a single value, but when I am using it in table with columns it is always showing 1, so it is counting per column row, I would like to get the same value(91) regardless of additional variables.
Slicer for 'Calendar'[Date]:PKPK90_0-1678831756527.png

 

Card visual: PKPK90_1-1678831804983.png

 

Connection:
MaterialTransactions is my table with all data needed
Calendar is my calendar table, also connected with different tables.
PKPK90_2-1678832060219.png

 

Expected result:

PKPK90_0-1678833259436.png

 

 

 
2 REPLIES 2
PKPK90
Helper I
Helper I

Thank you for your input, but still I am receiving "1" per row.

wdx223_Daniel
Super User
Super User

CountWeeks = CALCULATEDISTINCTCOUNT('Calendar'[YearWeek]), FILTER(ALLSELECTED('Calendar'), 'Calendar'[Date]>=[Minimum date] && 'Calendar'[Date]<=[Maximum date]))

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.