Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |