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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Users online (2,504)