Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi All,
I'm looking for a if and time dax statement that gives me the total count of rows in Table[Order Time] that are less than 10am as "breakfast" and greater than 10 as "Lunch".
Thank you in advance!
breakfast =
CALCULATE (
COUNTROWS ( 'fact' ),
FILTER (
'fact',
TIMEVALUE ( CALCULATE ( MAX ( 'fact'[Value] ) ) ) <= TIME ( 10, 00, 00 )
)
)
lunch =
CALCULATE (
COUNTROWS ( 'fact' ),
FILTER (
'fact',
TIMEVALUE ( CALCULATE ( MAX ( 'fact'[Value] ) ) ) > TIME ( 10, 00, 00 )
)
)
@am_i_really Try:
Breakfast =
VAR __Table = ADDCOLUMNS('Table',"__Hour",HOUR([Order Time]))
VAR __Result = COUNTROWS(FILTER(__Table,[__Hour] < 10))
RETURN
__Result
Lunch =
VAR __Table = ADDCOLUMNS('Table',"__Hour",HOUR([Order Time]))
VAR __Result = COUNTROWS(FILTER(__Table,[__Hour] >= 10))
RETURN
__Result
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
8 | |
8 | |
8 |