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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Banshee
Frequent Visitor

Median number of calls per week for dates selected in slicer

I have a table with answered calls like:

DateCallIDCalls
9-24-2025565461
9-25-2025565821
9-25-2025546561

 

i have a slicer populated from a dates table with WeekEnding.

 

I want a measure that finds the median number of calls for the range of week endings selected.

 

Any and all help much appreciated.

2 ACCEPTED SOLUTIONS
AmiraBedh
Super User
Super User

Hello !

Thank you for posting on Fabric community.

You need a dimension for dates that has a column WeekEnding for each specific date :

Dates = 
VAR StartDate = DATE(2025,9,20)
VAR EndDate   = DATE(2025,10,05)
RETURN
ADDCOLUMNS (
    CALENDAR ( StartDate, EndDate ),
    "WeekEnding", [Date] + ( 7 - WEEKDAY ( [Date], 1 ) )  
)

 

Create a relationship between your fact table and the date dimension based on the date column :

AmiraBedh_0-1759351637942.png

 

Then create the following measure :

Median Calls (Selected Weeks) = 
MEDIANX (
    VALUES ( Dates[WeekEnding] ),
    CALCULATE ( COUNTROWS ( Calls ) )
)

 

AmiraBedh_1-1759351722344.png

 

you can find the solution in the attached pbix

 

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

v-kpoloju-msft
Community Support
Community Support

Hi @Banshee,

Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to @AmiraBedh, for her inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.

vkpolojumsft_0-1759467262709.png

 


I am also including .pbix file for your better understanding, please have a look into it.

Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

View solution in original post

3 REPLIES 3
v-kpoloju-msft
Community Support
Community Support

Hi @Banshee,

Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to @AmiraBedh, for her inputs on this thread. I reproduced the scenario, and it worked on my end. I used my sample data and successfully implemented it.

vkpolojumsft_0-1759467262709.png

 


I am also including .pbix file for your better understanding, please have a look into it.

Hope this clears it up. Let us know if you have any doubts regarding this. We will be happy to help.

Thank you for using the Microsoft Fabric Community Forum.

AmiraBedh
Super User
Super User

Hello !

Thank you for posting on Fabric community.

You need a dimension for dates that has a column WeekEnding for each specific date :

Dates = 
VAR StartDate = DATE(2025,9,20)
VAR EndDate   = DATE(2025,10,05)
RETURN
ADDCOLUMNS (
    CALENDAR ( StartDate, EndDate ),
    "WeekEnding", [Date] + ( 7 - WEEKDAY ( [Date], 1 ) )  
)

 

Create a relationship between your fact table and the date dimension based on the date column :

AmiraBedh_0-1759351637942.png

 

Then create the following measure :

Median Calls (Selected Weeks) = 
MEDIANX (
    VALUES ( Dates[WeekEnding] ),
    CALCULATE ( COUNTROWS ( Calls ) )
)

 

AmiraBedh_1-1759351722344.png

 

you can find the solution in the attached pbix

 

 

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Thank you so much!

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