Forum Discussion
sbuster
Helper I
3 years agorecord with max value by day
I have a dataset below that has multiple records on a given day. What I would like to do is find the AssetID with the max number (count) of ExceptionID by day.... I was able to use groupby a...
johnt75
Super User
3 years agoYou could try
Top exceptions by day =
GENERATE (
VALUES ( 'Table'[Date] ),
TOPN (
1,
CALCULATETABLE (
GROUPBY (
transactions,
transactions[AssetID],
"Exception Count", COUNTX ( CURRENTGROUP (), transactions[ExceptionID] )
)
),
"Exception Count"
)
)
sbuster
Helper I
3 years agoThis formula simply returns the same result as my rollup table shown above. The next step is to produce 1 record per day, where that record should be the one with the max exception count. So basically 1 record for every day, with the assetid and the exception count (which is the result of finding the max exception count).