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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mh2587
Super User
Super User

Week Count in XTable based on date range with Inactive relation of Date Table

I have two tables

1.Customer > Customer Name , Created Date

2.Date Table > Year , Month , Date , Week In Year
Now the scenario is: I want count the Week In Year(Date Table) But In the range of Created Date which is the column in Customer Table but the issue is the relation is inactive between customer and date table 

 

 

 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



2 REPLIES 2
amitchandak
Super User
Super User

@mh2587 , Try a measure  like

 

=
var _max = maxx(allselected(Customer),Table[Created Date])
var _min = minx(allselected(Customer),Table[Created Date])
return
calculate( distinctcount(Date[Week In Year]), filter('Date', 'Date'[Date] <=_max && 'Date'[Date] >=_min))

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

Thanks for the response but it's Not working 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.