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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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