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
Redcol
New Member

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
New Member

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.