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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Redcol
Regular Visitor

Filtering data based on another table

Hi. Im trying to create a SUM measure 

Calls Offered:=sum(CallsApplicationStats[CallsOffered])

 

now there is a [Time] field in CallsApplicationStats [cas]

and I wanrt to filter this measure where the [TIME] is greater than or equal to and less than

i have done this in SQL Server in a WHERE Clause

 

AND cas.[TIME]>=ca.ApplicationTimeOpen
AND cas.[Time] < ca.ApplicationTimeClose
 
this is to get a count of how many calls we had between the opening and closing hours.
I have not filtered this at source as the buisness are interested in calls that came in Outside these hours as well
 
Any help would be apprciated 🙂
2 REPLIES 2
Anonymous
Not applicable

You have to have two tables that you'll use on slicers or on rows and columns of a matrix. One will store all the ApplicationTimeOpen's and the other one ApplicationTimeClose's. Let's call them AppTimeOpen (with Time column) and AppTimeClose (with Time column as well).

 

Once you have them, then you can create a measure:

 

# Calls Offered =
var __timeOpen = SELECTEDVALUE( AppTimeOpen[Time] )
var __timeClose = SELECTEDVALUE( AppTimeClose[Time] )
var __callsOffered =
	CALCULATE(
		[Calls Offered], -- your measure
		CallsApplicationStats[TIME] >= __timeOpen,
		CallsApplicationStats[TIME] < __timeClose
	)
return
	__callsOffered

When you do this, please do not use the [TIME] column in your report. Hide the column.

 

Best

Darek

Redcol
Regular Visitor

Missed update 

ca.ApplicationTimeOpen & ca.ApplicationTimeClose are in another table.

I have created a calculated column in CallsApplicationStats to bring these both in if that helps 🙂

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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