Forum Discussion
Filter Max hour by Date
- Anonymous3 years ago
HI GustavoKamchen,
You can create a calculated column with the following formula to use the current date to find 'hour', then use the above 'hour' and current date to get the corresponding Production values.
formula = VAR _maxhour = CALCULATE ( MAX ( Table[Hour] ), FILTER ( Table, [Date] = EARLIER ( Table[Date] ) ) ) RETURN CALCULATE ( MAX ( Table[Production] ), FILTER ( Table, [Date] = EARLIER ( Table[Date] ) && [Hour] = _maxhour ) )EARLIER, EARLIEST – DAX Guide - SQLBI
Regards,
Xiaoxin Sheng
HI GustavoKamchen,
You can create a calculated column with the following formula to use the current date to find 'hour', then use the above 'hour' and current date to get the corresponding Production values.
formula =
VAR _maxhour =
CALCULATE (
MAX ( Table[Hour] ),
FILTER ( Table, [Date] = EARLIER ( Table[Date] ) )
)
RETURN
CALCULATE (
MAX ( Table[Production] ),
FILTER ( Table, [Date] = EARLIER ( Table[Date] ) && [Hour] = _maxhour )
)
EARLIER, EARLIEST – DAX Guide - SQLBI
Regards,
Xiaoxin Sheng
- Anonymous3 years agoNot applicable
Hello,
I wrote there my question. https://community.powerbi.com/t5/Desktop/Show-only-data-from-the-latest-date/m-p/2852862/highlight/true#M983300
So i saw yor codes and i have tried but nothing happened. There was no error.
Can you help me?
note: I don't want to see earlier dates, i need last date and hour line.
Thak you
- GustavoKamchen3 years agoFrequent Visitor
How can I calculate average of daily production?