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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |