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
hoyty
Regular Visitor

Filter based on a calculation per row?

I feel like what I am trying to do is straightforward and I am missing the way to do it.

 

I have a measure that is:

After 4:00 = COUNTAX(FILTER('Attendance Review','Attendance Review'[SignoutTime] > TIMEVALUE("16:00") && ISBLANK('Attendance Review'[Afternoon Bus])),'Attendance Review'[SignoutTime])
 
What I want to do is have a filter that is essentially:
Is After 4:00 = 'Attendance Review'[SignoutTime] > TIMEVALUE("16:00") && ISBLANK('Attendance Review'[Afternoon Bus])
 
It is sort of a SQL WHERE statement on the data. I just can't figure out where an how to enter this statement to have it work. I could do a filter on the two fields but I can't figure out how to do a time only filter on the time field.
 
Thanks for any advice.
4 REPLIES 4
bolfri
Solution Sage
Solution Sage

Create a new column in you table:

After 4:00 = 'Attendance Review'[SignoutTime ] > TIMEVALUE("16:00") && OR(ISBLANK('Attendance Review'[Afternoon Bus ]),'Attendance Review'[Afternoon Bus ]="")

bolfri_1-1674006452371.png

 

Then you can use it as a filter. Note that using IF statement you can return the values that you want on filter.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks, that didn't work either. I think my issue is my table is a summary / count table and I am trying to filter on individual items rather than the counts. My solution for now is to edit the query

 

#"dbo_Attendance Review" = Source{[Schema="dbo",Item="Attendance Review"]}[Data],
#"Filtered Rows" = Table.SelectRows(#"dbo_Attendance Review", each [SignoutTime] > #time(16, 0, 0))

 

It isn't as flexible but gets the job done.

bolfri
Solution Sage
Solution Sage

Can you provide some sample data to work with? PBIX file with sample rows and description what do you expect (example) would be great. 🙂 You can use wetransfer.com to send data/pbix file.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




The data has student names so it is difficult to share. I am pulling from SQL View. I want to filter on one column being flase / null and another that is time being greater than 4:00 PM.

hoyty_0-1674003931487.png

The final column in the table shows the count that is evaluating the forumla but I want to use that as a filter rather than a count.

 

Is there a way to enter a filter as a command rather than on a single field?

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!

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