Forum Discussion
am_i_really
3 years agoFrequent Visitor
IF Time DAX Measure
Hi All, I'm trying to write a DAX Measure to determine how many transactions are breakfast vs lunch. This is what I have but its not working. Any idea what I'm doing wrong? IF(COUNT(Master[O...
- 3 years ago
am_i_really Sorry, I had some syntax errors in that, try this:
Measure Breakfast = VAR __Table = ADDCOLUMNS( 'Table', "__Type", IF([Order Time] < TIME(11,00,00),"Breakfast", "Lunch") ) VAR __Result = COUNTROWS(FILTER(__Table, [__Type] = "Breakfast")) RETURN __Result
am_i_really
3 years agoFrequent Visitor
Greg_Deckler
Community Champion
3 years agoam_i_really Sorry, I had some syntax errors in that, try this:
Measure Breakfast =
VAR __Table =
ADDCOLUMNS(
'Table',
"__Type", IF([Order Time] < TIME(11,00,00),"Breakfast", "Lunch")
)
VAR __Result = COUNTROWS(FILTER(__Table, [__Type] = "Breakfast"))
RETURN
__Result