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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nhalloran24
Frequent Visitor

Specific amount of items within date and hour time frame

Data.PNG

 

Table:

 

Date | Location Number | Hour | Count of Items | Dock Door 

 

 

I have been trying to figure out a formula/process to figure out the solution to my problem, but spinning in circles. I am looking to get: on a specific date, in a specific hour, if the count of items is more than 50 at the dock door location (multiple dock doors within a location) that is flags as productive. If less than 50 then it flags as non productive. 

 

Hour count is 1 - 24, so just looking to get in a time frame of one hour, each day, if a particular location at their particular dock door has more than 50 items going out or less than 50 items going out. 

 

Hope this makes sense. If you need further explanation, let me know. 

 

Thanks for any help.

3 REPLIES 3
Anonymous
Not applicable

-- Say you have a measure that gives you the count
-- of items for any selections of attributes in
-- your dimensions. Name it [Count of Items].
-- Then try this:

[Flag] = IF( [Count of Items] > 50, "productive", "non-productive")

-- If you put Date, Hour and Door Location on axes and slicers,
-- you'll get what you need. If you miss to filter any one
-- of the attributes, the measure will still return an outcome
-- but you have to interpret it correctly. If you want to
-- make sure that this only shows results if all three attributes
-- have been selected, then you should use this:

[Flag] =
var __oneDaySelectedOnly = HASONEFILTER( TableWithDates[Date] )
var __oneHourSelectedOnly = HASONEFILTER( TableWithHours[Hour] )
var __oneDockDoorSelected = HASONEFILTER( TableWithDockDoors[Dock Door] )
var __shouldDisplay = TRUE()
	&& __oneDaySelectedOnly
	&& __oneHourSelectedOnly
	&& __oneDockDoorSelected
var __flag = 
	IF( [Count of Items] > 50, "productive", "non-productive")
return
	if( __shouldDisplay, __flag )
	
-- Please replace the names of the table(s) with the
-- tables you have in your model. It's probably one
-- and the same table 🙂

Best

Darek

nhalloran24
Frequent Visitor

Been stuck on this for a couple of days now, any help would be appreciated!

Please provide sample data (not a picture of the data) and your desired outcome.

 

Also are the day and hour selected by slicer?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors