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
calgarygeologis
Frequent Visitor

End of Week Count Hierarchy

I have a count measure which I'm trying to display in a table with the week number and with the Month name. Some weeks span across the end of a month and my table is return two weekly values (one at the end of the month and one at the end of the actual week.) Can I get the table to display only the end of week value?

 

As you can see week 14 starts at the end of March and it ends in April. I am getting a value for the last day of March in week 14 and for the last day of week 14. I would like to only see the last day of week 14.

 

Capture.PNG

 

In case it helps here is my count measure:

Count =
SUMX(
values ( Location[Area]),
VAR LastCountDate = Calculate( MAX ( FactTable[Date] ))
RETURN
CALCULATE (
SUM ( FactTable[Data] ),
'DateTable'[Date] = LastWorkforceDate
))
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@calgarygeologis , You need to have column like these in date table and then you can filter on last date

 

Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

last date = if([Week End date] <eomonth([date],0),[Week End date],eomonth([date],0))

Flag =if([Date] =[last date],1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@calgarygeologis , You need to have column like these in date table and then you can filter on last date

 

Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)

last date = if([Week End date] <eomonth([date],0),[Week End date],eomonth([date],0))

Flag =if([Date] =[last date],1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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