Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

DAX for MIn/Max based on count

Hello All, Need hep!   I need to dispay (on card tile) min and max hour when the count of crime is min and max. Hour is on x axis and crime # on y axis. In this example I need to dispay max time as...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    Hi Anonymous

     

    Check this file here

     

    Try this

    Time_MaxCrime =
    VAR MaxCount =
        MAXX ( VALUES ( Table1[Time] ), CALCULATE ( COUNT ( Table1[Crime Type] ) ) )
    RETURN
        CALCULATE (
            CONCATENATEX (
                FILTER (
                    VALUES ( Table1[Time] ),
                    CALCULATE ( COUNT ( Table1[Crime Type] ) = MaxCount )
                ),
                Table1[Time]
            )
        )