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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors