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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors